se_m.sql 716 B

12345678910111213141516171819202122232425
  1. -- The m_test table is created with the gid integer column,
  2. -- which uniquely identifies the row, and the pt1 point column
  3. -- that stores the sample geometry.
  4. CREATE TABLE m_test (gid integer,
  5. pt1 ST_Point);
  6. -- The INSERT statements insert a point with measures
  7. -- and a point without measures.
  8. INSERT INTO m_test VALUES(
  9. 1,
  10. ST_PointFromText('point (10.02 20.01)', 1000)
  11. );
  12. INSERT INTO m_test VALUES(
  13. 2,
  14. ST_PointFromText('point zm (10.02 20.01 5.0 7.0)', 1000)
  15. );
  16. -- In this query the SE_M function lists the measure values of the points.
  17. -- Because the first point doesn't have measures, the SE_M function returns NULL.
  18. SELECT gid, SE_M(pt1) The_measure
  19. FROM m_test;