定义
ST_Is3d 以 ST_Geometry 作为输入参数,如果给定几何具有 z 坐标,则返回 1(Oracle 和 SQLite)或 t (PostgreSQL);否则返回 0(Oracle 和 SQLite)或 f (PostgreSQL)。
语法
Oracle 和 PostgreSQL
sde.st_is3d (geometry1 sde.st_geometry)
SQLite
st_is3d (geometry1 geometryblob)
返回类型
布尔型
示例
本示例创建表 is3d_test,并通过记录对其进行填充。
接着,使用 ST_Is3d 进行检查以查看是否存在任何具有 z 坐标的记录。
Oracle
CREATE TABLE is3d_test (
id integer,
geo sde.st_geometry
);
INSERT INTO IS3D_TEST VALUES (
1902,
sde.st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO IS3D_TEST VALUES (
1903,
sde.st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO IS3D_TEST VALUES (
1904,
sde.st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO IS3D_TEST VALUES (
1905,
sde.st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, sde.st_is3d (geo) Is_3D
FROM IS3D_TEST;
ID IS_3D
1902 0
1903 0
1904 1
1905 1
PostgreSQL
CREATE TABLE is3d_test (
id integer,
geo sde.st_geometry
);
INSERT INTO IS3D_TEST VALUES (
1902,
sde.st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO IS3D_TEST VALUES (
1903,
sde.st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO IS3D_TEST VALUES (
1904,
sde.st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO IS3D_TEST VALUES (
1905,
sde.st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, sde.st_is3d (geo)
AS Is_3D
FROM is3d_test;
id is_3d
1902 f
1903 f
1904 t
1905 t
SQLite
CREATE TABLE is3d_test (
id integer
);
SELECT AddGeometryColumn (
NULL,
'is3d_test',
'geo',
4326,
'geometryzm',
'xyzm',
'null'
);
INSERT INTO is3d_test VALUES (
1902,
st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO is3d_test VALUES (
1903,
st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO is3d_test VALUES (
1904,
st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO is3d_test VALUES (
1905,
st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, st_is3d (geo)
AS "Is_3D"
FROM is3d_test;
id Is_3D
1902 0
1903 0
1904 1
1905 1