Advertisement
lmotta

Get coordinate of vertices from polygon (PostGis/Postgresql)

Aug 11th, 2011
1,572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Extension PostGIS for Postgreql
  2. -- ST_DumpPoints(Geometry):
  3. --  Return path, geom
  4.  
  5. --select (ST_DumpPoints(the_geom)).*
  6. --from alos_prisma
  7.  
  8. select id idPoly, path[2] numPoint, ST_X(geom) X, ST_Y(geom) Y
  9. from
  10. (
  11. select id, (ST_DumpPoints(the_geom)).*
  12. from alos_prisma
  13. ) t
  14.  
  15. -- Only First record
  16. --select id, ST_X(geom), ST_Y(geom)
  17. --from
  18. --(
  19. -- select id, (ST_DumpPoints(the_geom)).geom
  20. -- from
  21. -- (
  22. --  select id, the_geom
  23. --  from alos_prisma
  24. --  limit 1
  25. -- ) t1
  26. --) t2
  27.  
  28.  
  29. -- All records
  30. --select id, ST_X(geom), ST_Y(geom)
  31. --from
  32. --(
  33. -- select id, (ST_DumpPoints(the_geom)).geom
  34. -- from alos_prisma
  35. --) t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement