# which map projection should I use to calculate distance in Poland

I'm using/learning geodjango + postgis, and I'm trying to calculate distance between 2 cities in Poland. First using WGS84/4326 I define 2 points, and then after transforming this points into spherical mercator 900913 i get distance which is about 40km too long. Which map projection should I use then? Where can I find proper srid's for different countries?

sorry for the delay, 2 cities (lat; long): Slupsk(54.465249;17.026062) and Koszalin(54.193378;16.179428)

-
do you have the latitude and longitude values so we can check? – mhoran_psprep Mar 19 '12 at 1:52
Ideally, questions should stand on their own, without comment. Please edit the extra information, provided in comments above and below, into the body of the question. – Martin F Apr 21 '15 at 15:07

That's what picking a decent map projection is all about. I don't know your lat/long range but you can query projections relevant to a lat/long bounding box at the EPSG Geodetic Parameter Dataset. This should give some codes to test out.

EDIT: Thanks for posting your coordinates. When you just calculate a cartesian distance between these points in a Plate Carree or something similar projection, you get something like 90km which is obviously the wrong result from a wrong method.

Others have explained the 'math route' using a spherical calculation, so I took the 'tool route' and retrieved the ETRS89 projection from the EPSG database based on your coordinates, measuring in this coordinate system I get about 63km, which is the considerable difference we're seeing.

-
thank you - would u mind explaining me how to find the proper projection for my coordinates on epsg.org page - all i can see there is a bunch of links to same white papers or other thinks which i don't ever try to understand. Thanks in advance – agend Mar 31 '12 at 7:06
epsg-registry.org is actually the more direct link and will point you to a this dialog without any additional searching around. The most quick/dirty method of choosing a system would be to review the "Area Description" field and pick a ProjectedCRS system that appears to describe your geographical area most specifically (eg "Poland" vs "Europe"). You could do some quick research to see what metric is important to you to preserve in an available projection (distance, area, bearing, etc). However for pure distance, (< 1-2m), you should use one of the geodesic methods below. – WolfOdrade Apr 2 '12 at 4:23

Use latitude and longitude and the great circle distance, not a map projection.

-
i tried to use pyproj which is python binding for proj4 library. And using 'sphere' ellipsoid i still get distance which is about thirty km too big. `g = pyproj.Geod(ellps='sphere') a, b, dist = g.inv(54.186548, 16.177368, 54.465249, 17.026062) dist = 98516.645068962112` – agend Mar 24 '12 at 17:27
Agend, you appear to have mixed up the latitudes and longitudes. `g.inv(16.177368, 54.186548, 17.026062, 54.465249)` will return 63335.3 meters, which is 35.1813 kilometers shorter--about what you're looking for. – whuber Mar 24 '12 at 20:25
so now i'm getting totally lost - will have look at that - thank you – agend Mar 31 '12 at 7:04

``````2 cities (lat; long): Slupsk(54.465249;17.026062) and Koszalin(54.193378;16.179428)