[postgis-users] break road linestrings intelligently

Richard Greenwood richard.greenwood at gmail.com
Tue Sep 25 18:43:10 PDT 2012

I have a table of linestrings representing road centerlines. The
linestrings have the common "from" and "to" address min/max values.
But the linestrings are not broken at all of the intersecting streets.
So I need to break the linestrings at all intersections, but I need to
populate the "from" and "to" values appropriately in the new
linestrings. The addressing is based on line length. So I might start
with a linestring that goes from 100 to 500 and has two intersecting
streets. I break the original linestring into 3 new linestrings, but
how do I populate the "from" and "to" values? If I know the order of
the 3 new linestrings it would be very easy to calculate the new
values based on the length of each new linestring, eg. line #1
100-240, line#2 241-385, line #3 386-500 or some such thing.

It seems like something that topology should help with, but I'm not
sure where to start. Sorry if I haven't clearly defined my problem.
Any suggestions are appreciated.


Richard Greenwood
richard.greenwood at gmail.com

More information about the postgis-users mailing list