st_geomfromtext.sql 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. -- The geometry_test table contains the integer gid column, which
  2. -- uniquely identifies each row, and the g1 column, which stores the geometry.
  3. CREATE TABLE geometry_test (gid smallint,
  4. g1 ST_Geometry);
  5. -- The INSERT statements insert the data into the gid and g1
  6. -- columns of the geometry_test table. The ST_GeomFromText function
  7. -- converts the text representation of each geometry into its
  8. -- corresponding Spatial DataBlade instantiable subclass.
  9. INSERT INTO geometry_test VALUES(
  10. 1,
  11. ST_GeomFromText('point (10.02 20.01)',1000)
  12. );
  13. INSERT INTO geometry_test VALUES(
  14. 2,
  15. ST_GeomFromText('linestring (10.01 20.01, 10.01 30.01, 10.01 40.01)',1000)
  16. );
  17. INSERT INTO geometry_test VALUES(
  18. 3,
  19. ST_GeomFromText('polygon ((10.02 20.01, 11.92 35.64, 25.02 34.15, 19.15 33.94, 10.02 20.01))',1000)
  20. );
  21. INSERT INTO geometry_test VALUES(
  22. 4,
  23. ST_GeomFromText('multipoint (10.02 20.01,10.32 23.98,11.92 25.64)',1000)
  24. );
  25. INSERT INTO geometry_test VALUES(
  26. 5,
  27. ST_GeomFromText('multilinestring ((10.02 20.01, 10.32 23.98, 11.92 25.64),(9.55 23.75,15.36 30.11))',1000)
  28. );
  29. INSERT INTO geometry_test VALUES(
  30. 6,
  31. ST_GeomFromText('multipolygon (((10.02 20.01, 11.92 35.64, 25.02 34.15, 19.15 33.94, 10.02 20.01)),((51.71 21.73, 73.36 27.04, 71.52 32.87, 52.43 31.90, 51.71 21.73)))',1000)
  32. );