ST_EqualSRS function

The ST_EqualSRS function takes two spatial reference system identifiers as input parameters and returns 1 if the specified spatial reference systems are identical. Otherwise, 0 (zero) is returned. The offsets, scale factors, and the coordinate systems are compared.

If any of the specified spatial reference system identifiers is null, null is returned.

Syntax

Read syntax diagramSkip visual syntax diagramST_EqualSRS(srs_id1,srs_id2 )

Parameter

srs_id1
A value of type INTEGER that identifies the first spatial reference system to be compared with the spatial reference system identified by srs_id2.
srs_id2
A value of type INTEGER that identifies the second spatial reference system to be compared with the spatial reference system identified by srs_id1.

Return type

INTEGER

Example

Two similar spatial reference systems are created with the following calls.

call st_create_srs('NYE_12', 12, 0, 0, 1, 0, 1, 0, 1, 
         'NAD_1983_STATEPLANE_NEW_YORK_EAST_FIPS_3101_FEET', '')

call st_create_srs('NYE_22', 22, 0, 0, 1, 0, 1, 0, 1, 
         'NAD_1983_STATEPLANE_NEW_YORK_EAST_FIPS_3101_FEET', '')


These SRSs have the same offset and scale values, and they refer to the same coordinate systems. The only difference is in the defined name and the SRS ID. Therefore, the comparison returns 1, which indicates that they are the same.


VALUES ST_EqualSRS(12, 22)

Results:

1
-----------
          1