[postgis-users] break road linestrings intelligently

Martin Davis mtnclimb at telus.net
Tue Sep 25 21:37:31 PDT 2012


Here's one idea:

- keep the ID of the parent linestring on the extracted sublines
- join back to the original lines using the parent ID, and use the 
ST_Line_Locate_Point to determine the fractional index of the subline
- the fractional index values can be used to compute the proportional 
address subranges

The SQL is left as an exercise for the reader   8^)

Martin

PS Greetings from Victoria to JH!

On 9/25/2012 6:43 PM, Richard Greenwood wrote:
> 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.
>
> Rich
>




More information about the postgis-users mailing list