[Mapserver-users] distanceToPoint in kilometres?

Yewondwossen Assefa assefa at dmsolutions.ca
Mon Nov 3 16:04:55 EST 2003


One possible way of doing that would be to convert your 2 lat/long 
positions to a projected unit system and then use the distanceToPoint 
(or your local code) to compute the distance.
You can use the php_proj utility (which uses Proj.4) to do your 
conversion. If you are builing mapserver yourself, the file is 
php_proj.c inside the php3 directory and It should be built into a 
php_proj.so. If you are on windows, you can download the php_proj.dll 
which should be bundeled with the php zip file at 
http://www.maptools.org/php_mapscript/index.phtml

Later,

Sebastian Albrecht wrote:

> Hi everybody,
> 
> I just tried to use the distanceToPoint method in my PHP Mapscript
> application. It seems to calculate the mathematical distance of the
> two given points (Pythagoras?).
> 
> Of course this is not very useful because I cannot convert it to a
> metric distance so that a distance of 90,00 can be very short (at the
> poles) or very long.
> 
> Is there a possibility to calculate the real distance considering
> projection and ellipsoids? I think it might work with PROJ.4 somehow,
> but the whole site seems to be offline at the moment.
> 
> Does anybody have a clue?
> 
> Best regards,
> Sebastian
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------






More information about the mapserver-users mailing list