Skip to content

RS_RasterToWorldCoord

Converts raster pixel coordinates to world coordinates as a point.

Usage

geometry RS_RasterToWorldCoord(rast: raster, x: integer, y: integer)

Arguments

  • rast (raster): Input raster
  • x (integer)
  • y (integer)

Description

Pixel coordinates are 1-based, as in PostGIS ST_RasterToWorldCoord: (1, 1) is the upper-left pixel, and the result is the world coordinate of that pixel’s upper-left corner. Coordinates outside the grid, including 0, extrapolate along the geotransform.

Examples

SELECT RS_RasterToWorldCoord(RS_Example(), 10, 20);
┌─────────────────────────────────────────────────────────┐
│ rs_rastertoworldcoord(rs_example(),Int64(10),Int64(20)) │
│                         geometry                        │
╞═════════════════════════════════════════════════════════╡
│ POINT(80.08 126.07)                                     │
└─────────────────────────────────────────────────────────┘