Friday, 12 August 2016

What's the PostGIS equivalent to Extract Nodes in fTools / QGIS?



I'm looking to convert Park polygons from OSM into points.


The QGIS fTools Extract Nodes tool will convert a polygon to points at the vertices.


What is the equivalent function or work-flow in PostGIS?


enter image description here



Answer




Yo can use ST_DumpPoints(geom) to get the points listed.


Look at the example how to use it.


The result contains both the geometry and a path telling where in the polygon the point belongs. So to just get the geometry (points) do like this:


SELECT (ST_DumpPoints(the_geom)).geom

No comments:

Post a Comment