se_ismeasured.sql 989 B

1234567891011121314151617181920212223242526272829
  1. -- The measure_test table is created with two columns:
  2. -- a smallint column, gid, uniquely identifies the rows,
  3. -- while g1, a ST_Geometry column, stores the ST_Point geometries.
  4. CREATE TABLE measure_test (gid smallint,
  5. g1 ST_Geometry);
  6. -- The INSERT statements insert two records into the measure_test
  7. -- table. The first record stores a point that doesn't have a measure,
  8. -- while the second record does have a measure value.
  9. INSERT INTO measure_test VALUES(
  10. 1,
  11. ST_PointFromText('point (10 10)',1000)
  12. );
  13. INSERT INTO measure_test VALUES(
  14. 2,
  15. ST_PointFromText('point m (10.92 10.12 5)',1000)
  16. );
  17. -- The query lists the gid column and the results of
  18. -- the SE_IsMeasured function. The SE_IsMeasured function
  19. -- returns f (FALSE) for the first row because the point does not
  20. -- have a measure, and it returns t (TRUE) for the second row because
  21. -- the point does have measures.
  22. SELECT gid,SE_IsMeasured(g1) Has_measures
  23. FROM measure_test;