定义
ST_SRID 以几何对象作为输入参数,并返回其空间参考 ID。
语法
Oracle 和 PostgreSQL
sde.st_srid (geometry1 sde.st_geometry)
SQLite
st_srid (geometry1 geometryblob)
返回类型
整型
示例
创建下列表格:
在下一语句中,位于坐标 (10.01, 50.76) 处的点几何将插入到几何列 g1 中。创建点几何时,给点几何分配 SRID 值 4326。
ST_SRID 函数返回刚输入的几何的空间参考 ID。
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