Skip to content

RS_SetGeoReference

Sets the affine geotransform of a raster from a world-file georeference string of six whitespace-separated numbers in the order scalex, skewy, skewx, scaley, upperleftx, upperlefty — the same order RS_GeoReference emits. The format is ‘GDAL’ (default) or ‘ESRI’; in GDAL the upper-left coordinates refer to the corner of the upper-left pixel, while in ESRI they refer to its center. This is metadata-only: raster cell values are not resampled.

Usage

raster RS_SetGeoReference(rast: raster, georeference: string)
raster RS_SetGeoReference(rast: raster, georeference: string, format: string)

Arguments

  • rast (raster): Input raster
  • georeference (string): Six whitespace-separated numbers — scalex, skewy, skewx, scaley, upperleftx, upperlefty.
  • format (string): Coordinate convention for the upper-left values: ‘GDAL’ (default; alias ‘PIXEL’) places them at the pixel corner, ‘ESRI’ (alias ‘NODE’) at the pixel center. The center-to-corner shift maps through the full affine transform, so it is exact for skewed (rotated) rasters too.

See Coordinate Reference Systems for how SedonaDB represents and compares CRS.

Examples

SELECT RS_GeoReference(RS_SetGeoReference(RS_Example(), '2 0 0 -3 100 200'));
┌────────────────────────────────────────────────────────────────────────────┐
│ rs_georeference(rs_setgeoreference(rs_example(),Utf8("2 0 0 -3 100 200"))) │
│                                    utf8                                    │
╞════════════════════════════════════════════════════════════════════════════╡
│ 2.0000000000…                                                              │
└────────────────────────────────────────────────────────────────────────────┘
SELECT RS_GeoReference(RS_SetGeoReference(RS_Example(), '2 0 0 -3 101 198.5', 'ESRI'));
┌──────────────────────────────────────────────────────────────────────────────┐
│ rs_georeference(rs_setgeoreference(rs_example(),Utf8("2 0 0 -3 101 198.5"),U │
│                                tf8("ESRI")))…                                │
╞══════════════════════════════════════════════════════════════════════════════╡
│ 2.0000000000…                                                                │
└──────────────────────────────────────────────────────────────────────────────┘