se_z.sql 749 B

1234567891011121314151617181920212223242526
  1. -- The z_test table is created with two columns: the gid column,
  2. -- which uniquely identifies the row, and the pt1 point column.
  3. CREATE TABLE z_test (gid integer,
  4. pt1 ST_Point);
  5. -- The INSERT statements insert two rows.
  6. -- One is a point without a Z coordinate or a measure.
  7. -- The other has both a Z coordinate and a measure.
  8. INSERT INTO z_test VALUES(
  9. 1,
  10. ST_PointFromText('point (10.02 20.01)', 1000)
  11. );
  12. INSERT INTO z_test VALUES(
  13. 2,
  14. ST_PointFromText('point zm (10.02 20.01 5.0 7.0)', 1000)
  15. );
  16. -- The query lists the gid column and the double-precision Z coordinate
  17. -- of the points. The first row is NULL because the point does not have
  18. -- a Z coordinate.
  19. SELECT gid, SE_Z(pt1) z_coord
  20. FROM z_test;