[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] river network
From:       Kevin Neufeld <kneufeld () refractions ! net>
Date:       2009-02-19 6:52:46
Message-ID: 499D01BE.30400 () refractions ! net
[Download RAW message or body]

Hi Surya,

No, I didn't say it should be, only that I assumed it was.  It only 
matters in the query and how you look at things.  If you are digitized 
in an upstream direction, then the stream mouth will be the startpoint 
of the linestring and the headwaters the endpoint ... so you would 
reverse the logic in your query (find all streams whose startpoint (or 
mouth) touches the endpoint (or headwater) of your token stream).

SELECT b.*
FROM streams a, streams b
WHERE a.stream_id = 1     -- your specified segment
AND a.the_geom && b.the_geom
AND ST_Distance(
  ST_EndPoint(a.the_geom),
  ST_StartPoint(b.the_geom)
) = 0;

Cheers,
Kevin

storma-ipb@indo.net.id wrote:
> You said that the river should be digitized in downstraem
> direction (mimicing the river flow??). Is there any different
> when we digitized them in upstream direction?
>
>
> best regards,
> surya
>   
>>
>> -- Assuming your dataset is properly noded, directionalized
>> -- and digitized in a downstream direction, this will find
>> -- all streams that enter into stream with id = 1
>> SELECT b.*
>> FROM streams a, streams b
>> WHERE a.stream_id = 1     -- your specified segment
>> AND a.the_geom && b.the_geom
>> AND ST_Distance(
>>   ST_StartPoint(a.the_geom),
>>   ST_EndPoint(b.the_geom)
>> ) = 0;
>>
>>     
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic