定义
ST_IsMeasured 以几何对象作为输入参数,如果给定几何具有测量值,则返回 1(Oracle 和 SQLite)或 t (PostgreSQL);否则返回 0(Oracle 和 SQLite)或 f (PostgreSQL)。
语法
Oracle 和 PostgreSQL
sde.st_ismeasured (geometry1 sde.st_geometry)
SQLite
st_ismeasured (geometry1 geometryblob)
返回类型
布尔型
示例
创建表 ism_test,并向其中插入值;然后确定 ism_test 表中哪些行包含测量值。
Oracle
CREATE TABLE ism_test (
id integer,
geom sde.st_geometry
);
INSERT INTO ISM_TEST VALUES (
19,
sde.st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO ISM_TEST VALUES (
20,
sde.st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO ISM_TEST VALUES (
21,
sde.st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO ISM_TEST VALUES (
22,
sde.st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, sde.st_ismeasured (geom) M_values
FROM ISM_TEST;
ID M_values
19 0
20 1
21 0
22 1
PostgreSQL
CREATE TABLE ism_test (
id integer,
geom sde.st_geometry
);
INSERT INTO ISM_TEST VALUES (
19,
sde.st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO ISM_TEST VALUES (
20,
sde.st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO ISM_TEST VALUES (
21,
sde.st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO ISM_TEST VALUES (
22,
sde.st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, sde.st_ismeasured (geom)
AS has_measures
FROM ism_test;
id has_measures
19 f
20 t
21 f
22 t
SQLite
CREATE TABLE ism_test (
id integer
);
SELECT AddGeometryColumn (
NULL,
'ism_test',
'geom',
4326,
'geometryzm',
'xyzm',
'null'
);
INSERT INTO ISM_TEST VALUES (
19,
st_geometry ('polygon ((40 120, 90 120, 90 150, 40 150, 40 120))', 4326)
);
INSERT INTO ISM_TEST VALUES (
20,
st_geometry ('multipoint m(10 10 5, 50 10 6, 10 30 8)' , 4326)
);
INSERT INTO ISM_TEST VALUES (
21,
st_geometry ('linestring z(10 10 166, 20 10 168)', 4326)
);
INSERT INTO ISM_TEST VALUES (
22,
st_geometry ('point zm(10 10 16 30)', 4326)
);
SELECT id, st_ismeasured (geom)
AS "M_values"
FROM ism_test;
ID M_values
19 0
20 1
21 0
22 1