[postgis] newbie question about distance( )

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[postgis] newbie question about distance( )

gispmpf
forgive me for this newbie question about the distance() function:
i have two lines in the same table (roads)to see the distance between
them the correct sintax is:
select distance(FirstPoint(road l1),FirstPoint (r l2) from road r,
where road.id=1 and r.id=2;

is that correct?

Also there is any function with get the interccection between two
lines?

Thanks
João

Brenn Erik wrote:
> Yes you can. You can use the PostGIS StartPoint() function to find
the
> starting point of each line. Then you can feed the start points to
the
> distance() function.

Right -

        distance(FirstPoint(l1), FirstPoint(l2) )

(there's also a LastPoint() function)

dave



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Promise to Quit
Nicotrol will help
http://us.click.yahoo.com/5vN8tD/AqSDAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/