st_y.sql 681 B

12345678910111213141516171819202122232425
  1. -- The y_test table is created with two columns: the gid column,
  2. -- which uniquely identifies the row, and the pt1 point column.
  3. CREATE TABLE y_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 y_test VALUES(
  9. 1,
  10. ST_PointFromText('point (10.02 20.01)', 1000)
  11. );
  12. INSERT INTO y_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 Y coordinate
  17. -- of the points.
  18. SELECT gid, ST_Y(pt1) y_coord
  19. FROM y_test;