Wednesday, 19 June 2019

postgis - How to simplify a routable network?


I have a network graph that I need to simplify in the sense of reducing the number of edges. The idea would be to merge nodes that are located close together and remove the connecting short edges.


How could this be achieved in PostGIS or GRASS? Or are there any better approaches to automatically simplify a network like this?



I've already tried ST_SnapToGrid function but I'm not happy with the results (grey = original, black = snapped):


enter image description here



Answer



The closest I've come so far is this:


v.clean input=roads output=snap5rmline tool=snap,rmline thresh=5 

It's snapping the roads with a tolerance of 5 meters and removing all zero-length lines. It's not an optimal solution since it seems to snap rather randomly to some vertex.


enter image description here


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