Skip to content

ST_SetCRS

Sets the Coordinate Reference System (CRS) for a geometry.

Usage

geometry ST_SetCRS(geom: geometry, target_crs: string)
geography ST_SetCRS(geog: geography, target_crs: string)

Arguments

  • geog (geography): Input geography
  • target_crs (string)
  • geom (geometry): Input geometry

Description

Sets a CRS to a geometry/geography. This is metadata-only - no coordinates are transformed.

This is different from ST_Transform which actually transforms coordinates.

Examples

SELECT ST_SetCRS(ST_Point(-122.35, 47.65), 'EPSG:4269');
┌────────────────────────────────────────────────────────────────────────┐
│ st_setcrs(st_point(Float64(-122.35),Float64(47.65)),Utf8("EPSG:4269")) │
│                                geometry                                │
╞════════════════════════════════════════════════════════════════════════╡
│ POINT(-122.35 47.65)                                                   │
└────────────────────────────────────────────────────────────────────────┘