<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Hi Milo,</DIV>
<DIV>Thanks for looking at this question,  I am looing for an automated method for grouping street segments together based on a given intersection, in other word creating groups of segment ids for all of the segments on either side of the intersection: 3 groups if the intersection looks like a "T", 4 groups if it looks like a "cross", etc.</DIV>
<DIV>The final objective is to run this query twice, to consider two cross streets on a single thoroughfare, then inner join them by "segment id" which then gives me all of the segment ids on a street between "cross street 1" and "cross street 2".  These segment ids will then be associated with scanned contract drawings maintained in a document management system (catalogued by projects, which in turn are catalogued by "on-street","cross street 1" and "cross street 2")</DIV>
<DIV>Since the inner join part is trivial, I figured I'd just ask about creating the sets of records that would be fed to it</DIV>
<DIV>Thanks,</DIV>
<DIV>Andrew<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Milo van der Linden <mlinden@zeelandnet.nl><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS Users Discussion <postgis-users@postgis.refractions.net><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, December 15, 2008 10:24:50 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [postgis-users] Crossing roads<BR></FONT><BR>Hello Andrew,<BR><BR>Can you give some more detail on the why part of this question? Why would you want to find all the elements that connect to elements that connect to an intersection? This sounds like you are either:<BR>- Trying to do routing and prepare the network for that (in that case; check to see if pgRouting is working for you)<BR>- Looking for an automated mechanism to group segments together<BR><BR>Kind regards,<BR><BR>Milo van der Linden<BR><BR>Obe, Regina wrote:<BR>> Andrew,<BR>>  Not sure I understand your
 question.  Are you saying your street segments are cut such that they only connect at junctions.  Kind of like tiger tlids.<BR>>  And given each intersection, you are trying to find continguous segments from the intersection?<BR>>  e.g.<BR>>  -----------        -------------  ---------------  Intersection -------------------------- -------------------------------  -----------------<BR>>      t3                              t2                  t1                                        s3                s4                             
 sn<BR>>                                                                                  |a1<BR>>                                                                                |a2<BR>>                                                                                |an<BR>> So you would keep on collecting segments as long as they are connected to
 the previous ones?<BR>>  Thanks,<BR>> Regina<BR>> <BR>> ------------------------------------------------------------------------<BR>> *From:* <A href="mailto:postgis-users-bounces@postgis.refractions.net" ymailto="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</A> [mailto:<A href="mailto:postgis-users-bounces@postgis.refractions.net" ymailto="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</A>] *On Behalf Of *Andrew Ross<BR>> *Sent:* Saturday, December 13, 2008 11:05 AM<BR>> *To:* <A href="mailto:postgis-users@postgis.refractions.net" ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR>> *Subject:* [postgis-users] Crossing roads<BR>> <BR>> <BR>> Hi Everybody,<BR>> <BR>> 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.<BR>> <BR>> <BR>> 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). <BR>>  <BR>> Can anybody give me a high level idea of what functions / methods can be used to achieve this?  <BR>>  <BR>> I¢ve gotten as far as identifying the 4 segments actually connected to the intersection using the ST_Intersection function.  <BR>>  <BR>> How would I get all other segments connected to these 4?  <BR>>  <BR>> 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.<BR>> <BR>>  <BR>> Thanks in advance,<BR>> <BR>> Andrew<BR>> <BR>>  <BR>>  <BR>>  <BR>>                                    1<BR>> <BR>>                                    1<BR>> <BR>>                                    1<BR>> <BR>>                                    1<BR>> <BR>>            222222222222 X 22222222222222<BR>> <BR>>                             
       1<BR>> <BR>>                                    1<BR>> <BR>>                                    1<BR>> <BR>>                                    1<BR>> <BR>>  <BR>>  <BR>>  <BR>>                                    A<BR>> <BR>>                                    A<BR>> <BR>>                                    A<BR>> <BR>>   
                                 A<BR>> <BR>>            BBBBBBBBBBXCCCCCCCCCCC<BR>> <BR>>                                    D<BR>> <BR>>                                    D<BR>> <BR>>                                    D<BR>> <BR>>                                    D<BR>> <BR>>  <BR>>  <BR>> ------------------------------------------------------------------------<BR>> <BR>>
 ------------------------------------------------------------------------<BR>> <BR>> *The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer. *<BR>> <BR>> ------------------------------------------------------------------------<BR>> <BR>> * Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. *<BR>> <BR>> * *<BR>> <BR>> * *<BR>> <BR>> ------------------------------------------------------------------------<BR>> <BR>> _______________________________________________<BR>> postgis-users mailing list<BR>> <A href="mailto:postgis-users@postgis.refractions.net"
 ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR>> <A href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR>>  <BR><BR>_______________________________________________<BR>postgis-users mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR></DIV></DIV></div><br>

      </body></html>