Definition
ST_SRID takes a geometry object and returns its spatial reference ID.
Syntax
Oracle and PostgreSQL
sde.st_srid (geometry1 sde.st_geometry)
SQLite
st_srid (geometry1 geometryblob)
Return type
Integer
Examples
The following table is created:
In the next statement, a point geometry located at coordinate (10.01, 50.76) is inserted into the geometry column g1. When the point geometry is created, it is assigned the SRID value of 4326.
The ST_SRID function returns the spatial reference ID of the geometry just entered.
Oracle
CREATE TABLE srid_test (g1 sde.st_geometry);
INSERT INTO SRID_TEST VALUES (
sde.st_geometry ('point (10.01 50.76)', 4326)
);
SELECT sde.st_srid (g1) SRID_G1
FROM SRID_TEST;
SRID_G1
4326
PostgreSQL
CREATE TABLE srid_test (g1 sde.st_geometry);
INSERT INTO srid_test VALUES (
sde.st_point ('point (10.01 50.76)', 4326)
);
SELECT sde.st_srid (g1)
AS SRID_G1
FROM srid_test;
srid_g1
4326
SQLite
CREATE TABLE srid_test (id integer);
SELECT AddGeometryColumn(
NULL,
'srid_test',
'g1',
4326,
'point',
'xy',
'null'
);
INSERT INTO srid_test VALUES (
1,
st_point ('point (10.01 50.76)', 4326)
);
SELECT st_srid (g1)
AS "SRID"
FROM srid_test;
SRID
4326