跳转至
🎉 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.

RS_PixelAsPoint

Note

If the pixel coordinates specified do not exist in the raster (out of bounds), RS_PixelAsPoint throws an IndexOutOfBoundsException.

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

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

Output:

IndexOutOfBoundsException: Specified pixel coordinates (6, 2) do not lie in the raster