Converts a spatial reference string from Esri well-known text (WKT) format to Open Geospatial Consortium (OGC) WKT format.
The key difference between the two formats is the DATUM name prefix: Esri WKT prefixes DATUM names with D_ (for example, D_China_2000), while OGC WKT omits that prefix (for example, China_2000).
Syntax
cstring ST_SrFromEsriWkt(cstring sr);Parameters
| Parameter | Description |
|---|---|
sr | The spatial reference string in Esri WKT format. |
Example
The following example converts a CGCS2000 (China Geodetic Coordinate System 2000) spatial reference string from Esri WKT to OGC WKT.
SELECT ST_srFromEsriWkt('GEOGCS["China Geodetic Coordinate System 2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]');Output:
st_srfromesriwkt
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]The D_ prefix in the DATUM name is removed: DATUM["D_China_2000",...] becomes DATUM["China_2000",...].
Usage notes
Use this function when your spatial reference string originates from an Esri tool such as ArcGIS or a Shapefile .prj file, and you need a standards-compliant OGC WKT string for subsequent spatial operations in PolarDB.
For a complete list of spatial reference functions, see the SpatialRef SQL reference.