Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
Compares two spatial reference system definitions.
ST_SpatialRefSys::ST_CompareWKT(transform-definition-1,transform-definition-2)
transform-definition-1
LONG VARCHAR
The first spatial reference system definition text
transform-definition-2
The second spatial reference system definition text
BIT Returns 1 if the two spatial reference systems are logically equivalent, otherwise 0.
Determines if two spatial reference systems (defined by WKT) are logically equivalent. The systems are considered logically equal if they are defined by the same authority with the same identifier or if the strings are exactly equal.
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
The following example shows that two spatial reference systems are considered equal even though they have different names:
SELECT ST_SpatialRefSys::ST_CompareWKT( 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]' , 'GEOGCS["WGS 84 alternate name",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]' ) Considered_Equal
The following example shows two spatial reference systems that are considered non-equal because they are defined by different authorities:
SELECT ST_SpatialRefSys::ST_CompareWKT( 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]' , 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["AnotherAuthority","4326"]]' ) Considered_NotEqual