Thursday, 15 March 2018

sql - How to merge connected lines with same direction (PostGis)


I am looking for a way to join all lines that are connected, have the same direction, i.e. start point of one is end point of the other, and share some common attributes. In fact, I want to connect oneway streets having an common start/end point and the same oneway direction. I found a way to identify pairs of lines that fulfill these condition:


select a.osm_id, a.name,a.oneway,
b.osm_id, b.name,b.oneway, from planet_osm_line a, planet_osm_line b
WHERE (st_startpoint(a.way)=st_endpoint(b.way) or st_endpoint(a.way)=st_startpoint(b.way))
and a.oneway=b.oneway ;


I am now looking for a way to merge the geometries of these lines.




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...