The ST_IsMeasured() function
The ST_IsMeasured() function returns t
(TRUE)
if the ST_Geometry object has measures; otherwise, returns f
(FALSE).
Properties of geometries are described in ids_spat_036.html.
Syntax
ST_IsMeasured(g1 ST_Geometry)
Return type
BOOLEAN
Example
The measure_test table is
created with two columns: a SMALLINT column, gid, which uniquely
identifies rows, and g1, an ST_Geometry column, which stores
the ST_Point geometries:
CREATE TABLE measure_test (gid smallint,
g1 ST_Geometry);
The
following INSERT statements insert two records into the measure_test table.
The first record stores a point that does not have a measure, while
the second record does have a measure value:
INSERT INTO measure_test VALUES(
1,
ST_PointFromText('point (10 10)',1000)
);
INSERT INTO measure_test VALUES(
2,
ST_PointFromText('point m (10.92 10.12 5)',1000)
);
The query lists the gid column and the
results of the ST_IsMeasured() function. The ST_IsMeasured() function
returns a
0
for the first row because the point does
not have a measure; it returns a 1
for the second
row because the point does have measures: SELECT gid,ST_IsMeasured(g1) Has_measures
FROM measure_test;
gid has_measures
1 f
2 t