[postgis-users] snapping all close-by lines in a set of 500,000

Greg Polanski polanski.greg at yahoo.com
Mon Jun 18 01:01:43 PDT 2012


Hello,
I have a question about snapping a huge number of linestrings such that all lines that are almost parallel and within 50m collapse into one.

I have some 500,000 streets from Openstreetmap (classified as secondary or larger roads). Most of them are made of two or more lanes. For a more compact storage and faster rendering I need only a visual representation of each road. How can I collapse for example the 6 lanes of a motorway into one linestring?

Do I have to run a loop over all roads, snapping each of them to all others within the given tolerance? This seems extremely slow. Or can it be done once for all geometries? 
Do you have some SQL examples for a similar processing step?

Thanks
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120618/34aa3553/attachment.html>


More information about the postgis-users mailing list