ST_SrsName function
The ST_SrsName function takes a geometry as an input parameter and returns the name of the spatial reference system in which the specified geometry is represented.
If the specified geometry is null, then null is returned.
Syntax
Parameter
- geometry
- A value of type ST_Geometry or one of its subtypes that represents the geometry for which the name of the spatial reference system is returned.
Return type
VARCHAR(128)
Example
Two points are created in different
spatial reference systems. The ST_SrsName function is used to find
out the name of the spatial reference system that is associated with
each point.
CREATE TABLE sample_points (id INTEGER, geometry, ST_Point)
INSERT INTO sample_points
VALUES (1, ST_Point ('point (80 180)', 0) )
INSERT INTO sample_points
VALUES (2, ST_Point ('point (-74.21450127 + 42.03415094)', 1) )
SELECT id, ST_SrsName (geometry) SRSNAME
FROM sample_points
Results:
ID SRSNAME
----------- ------------------------------
1 UNSPECIFIED
2 NAD83_SRS_1