[postgis-users] Distance between two points !

Fabio Rillo rillfab at hotmail.com
Fri Jul 6 01:59:00 PDT 2007


Hi 

I'm a newbie to PostGIS and I have same problem with function
distance(geometry, geometry). I need to know the distance between two points
IN METERS but distance return a number that represent the distance into
carthesian system but I don't know how convert this number in meters. Or
there is another war to do this!?!

 

PS.

I use geoserver to show maps and works very well.

This is a my example query:

 

select 

distance(

          geomfromtext('POINT(14.7926950454712 41.1229515075684)', 4236), 

          geomfromtext('POINT(14.7931413650513 41.1228904724121)', 4236) 

    );

Return 0,000450473592882729 !?!!?

 

 

Since SRID 4236 has UNIT["degree",.] I tried to use the "transform" function
in this way:

 

select  distance(

          transform(PointFromText('POINT(14.7926950454712
41.1229515075684)', 4236), 26986),

          transform(PointFromText('POINT(14.7931413650513
41.1228904724121)', 4236), 26986)

          );

 

Because SRID 26986 has UNIT["metre".]

 

 

But I didn't solve the problem.

 

Thanks Fabio

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070706/51fe6323/attachment.html>


More information about the postgis-users mailing list