I'd like to create a vectorLayer in QGIS to display all the points that form a LINESTRING or a MULTILINESTRING stored in a PostGIS DB.
I think that I need to transform all points of LINESTRING (or MULTILINESTRING) to POINT.
First Question:
Is there any PostGIS function to do that?
Second Question:
If I want to exclude duplicate points from the result POINT table, how can I do that?
Answer
To get point in order and link to orginal geometry use
SELECT (ST_DumpPoints(the_geom)).path as path, id, (ST_DumpPoints(the_geom)).geom FROM linestrings)
and remove dublicates from http://wiki.postgresql.org/wiki/Deleting_duplicates
remember that you need to have one unique id for dublicate removing, if you dont have one you need to create it
No comments:
Post a Comment