跳转至
🎉 Apache Sedona 1.9.1 已正式发布!🗺️ 新增 Geography SQL 函数、Box2D 与 Box3D 类型、栅格 Python UDF 等。查看发布说明 →

RS_PixelAsPoint

Introduction: Returns a point geometry of the specified pixel's upper-left corner. The pixel coordinates specified are 1-indexed. If colX and rowY are out of bounds for the raster, they are extrapolated assuming the same skew and translate values.

RS_PixelAsPoint

Format: RS_PixelAsPoint(raster: Raster, colX: Integer, rowY: Integer)

Return type: Geometry

Since: v1.5.0

SQL Example

SELECT ST_AsText(RS_PixelAsPoint(raster, 2, 1)) from rasters

Output:

POINT (123.19, -12)

SQL Example

Out of the grid, the coordinate is extrapolated rather than rejected. The raster below is 5 pixels wide, so column 6 is the first column past its right edge, and that column's upper-left corner lies on the edge itself (x = 123 + 5 × 8 = 163):

SELECT ST_AsText(RS_PixelAsPoint(RS_MakeEmptyRaster(1, 5, 10, 123, -230, 8), 6, 2))

Output:

POINT (163 -238)