[Mapserver-users] (Anti)geocoding and projections...

Ed McNierney ed at topozone.com
Fri Apr 4 16:04:44 EST 2003


Krzysztof -

A lot depends on how accurate you need to be, but no, I don't think using degrees as if they were square is a good idea.  Take your example (Warsaw, Poland).  It's at 52.25 degrees North latitude.  In Warsaw, one degree of latitude is 111 km, but one degree of longitude is only 68 km.  Computing simple distance as sqrt ((delta latitude) ^ 2 + (delta longitude) ^ 2) will give you very incorrect numbers.

If you a comfortable doing the distance calculations like this in degrees, you can get a much better result relatively easily by multiplying delta longitude by the cosine of the average latitude.  This is still not accurate , but it's much better and should work pretty well for short distances.  It's not a geodetically precise solution, but I'm suggesting it in case you need a simple calculation that's not too bad.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: Krzysztof Chodak [mailto:k.chodak at autoguard.pl]
Sent: Friday, April 04, 2003 3:46 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] (Anti)geocoding and projections...


Hello again,

as usual - have anyone of you got some tips...

I'm trying to make simple (anti)geocoding application (it must describe
geographic coordinates in text from available layers).
I got conceptual problems with projectioning. As my app should find a shape
nearest to given point i must be able to tell what is the actual ground
distance between this to shapes.  It will be a part of final string (f.e.
"Poland, Warsaw (10km from centre)"). Currently I use "raw" unprojected
WGS84 layers and I use standard MS functions to find closest shape - but
closest in degrees. I could use great circle calculation to find proper
distance in meters.

Do you think that degrees seach is a proper way to find closest shape?

Best regards
 
Krzysztof Chodak 

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list