[postgis-users] merging dual carriageway motorway lines
Stephen V. Mather
svm at clevelandmetroparks.com
Mon Dec 19 06:38:35 PST 2011
You might also look to straight skeletons or voronoi polygons (medial axis
transform) to collapse dual lines, which would require R-stat e.g.
http://www.joeconway.com/plr/, unless someone has a script kicking around to
do it in pure postgis.
Some early work on the problem:
http://proceedings.esri.com/library/userconf/proc96/TO400/PAP370/P370.HTM
(mostly useful conceptually)
BTW, these techniques work really well for collapsing smooth lines, like
those made of human built infrastructure. They do not work as well for
"bumpy" lines like rivers and such. For these, some filtering is needed,
such as the scale axis transform
http://www.balintmiklos.com/scale-axis/algorithm_siggraph_2010.html.
Best,
Steve
Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
svm at clevelandmetroparks.com
clevelandmetroparks.com
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Monday, December 19, 2011 9:21 AM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] merging dual carriageway motorway lines
On 12/19/2011 7:12 AM, Lauri Kajan wrote:
> Hi all,
>
> I have a road network loaded to PostGIS.
> Now I'm trying to find a way to merge parallel lines of a dual
> carriageway motorway to single a line?
> Or is there any?
Lauri,
I do not think there is any automated way to do this, but here are some
thoughts on how you might be able to do this.
1. collect the dual carriageway segments based on a common attribute
like name
2. for each segment, extract the points of the linestring and tag them
with the segments uid, you also might want to generate extra points
along this linestring and tag them with the segments uid also
3. for each point find the nearest point not on this segments uid, and
probably not on a connected segment within some limit distance and
insert a point that is the midpoint between the reference point and the
nearest point into a combine_point table.
4. stringify the combined_point table by connecting nearest points
within some limit distance.
Problems that you might encounter:
a. ramps backs that might get included by mistake.
b. loops or near loops like mountain switch that might confuse the stringify
c. combine carriageway does not follow mid-point path of dual carriage
because not all segments were selected or there were not enough points
generated along the original paths to compute the mid point path.
I have not tried to do this but it is how I would tackle the problem.
Others might have some good ideas also.
Thanks,
-Steve
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list