[postgis-users] Crossing roads

Paul Ramsey pramsey at cleverelephant.ca
Sat Dec 13 16:30:35 PST 2008


Stop thinking lines and start thinking endpoints.  If you convert your
lines into a set of start/end points then group on x/y you'll end up
an aggregation which defines your sets of road intersections.

If you want until Monday, I bet Kevin or Regina will drop full SQL
into your lap. I'm too lazy (stupid).

P.

2008/12/13 Andrew Ross <rummage_bin at yahoo.com>:
>
> Hi Everybody,
>
> I hope I'm posting to the right location (I just subscribed to this list).
> I have sent this question before but have not seen it listed anywhere yet.
>
> In any case, I have a road network in which all of the street segments are
> snapped together.  I need to group all of the line segments of two streets
> that cross each other (street 1 and street 2 as shown below) into 4 groups
> of segments defined as all of those located on either side of the
> intersection, (street segments A, street segments B, street segments C and
> street segments D, as shown at the bottom).
>
>
>
> Can anybody give me a high level idea of what functions / methods can be
> used to achieve this?
>
>
>
> I've gotten as far as identifying the 4 segments actually connected to the
> intersection using the ST_Intersection function.
>
>
>
> How would I get all other segments connected to these 4?
>
>
>
> Do I have to write a recursive function using ST_Touches ?  I'd rather not
> if there is a more elegant way of doing this.
>
>
>
> Thanks in advance,
>
> Andrew
>
>
>
>
>
>
>
>                                     1
>
>                                     1
>
>                                     1
>
>                                     1
>
>             222222222222 X 22222222222222
>
>                                     1
>
>                                     1
>
>                                     1
>
>                                     1
>
>
>
>
>
>
>
>                                     A
>
>                                     A
>
>                                     A
>
>                                     A
>
>             BBBBBBBBBBXCCCCCCCCCCC
>
>                                     D
>
>                                     D
>
>                                     D
>
>                                     D
>
>
>
>
>
> ________________________________
>
> _______________________________________________
> 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