[postgis] newbie question about distance( )

gispmpf gispmpf at yahoo.com.br
Thu Dec 6 04:24:00 PST 2001


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:
postgis-unsubscribe at yahoogroups.com

 

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





More information about the postgis-users mailing list