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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...