2

I'm new to projections topics and I've got a question that may be silly, but I hadn't found answer so far. I'm trying to use Miller's cylindrical projection for converting osm lat/lon to x,y values. I don't know how should I choose central meridian. It should be calculated for every transformation I make or I choose it once? What should be value of it?

I use this code to calculate miller's projection:

import sys
import math

lon = float(sys.argv[1])
lat = float(sys.argv[2])


x = lon # - CENTRAL_MERIDIAN?
y = 1.25 * math.log(math.tan(math.radians((math.pi/4.0) + (2.0/5.0*lat))))
  • What do you mean by " calculated for every transformation"? – Martin F Dec 1 '13 at 0:55
  • Do you really need to code the projection conversion yourself? If so, maybe add "python" as a tag? And i think there are tools available. – Martin F Dec 1 '13 at 0:56
  • From your answer I know that for my purposes I have to choose it once:). If you know some libraries for c++/qt that will calculate this for me I would be grateful to hear about them. – Wojciech Reszelewski Dec 1 '13 at 10:39
  • That should probably be separate question. I do know PostGIS can do it, but other folks will know plenty more. – Martin F Dec 1 '13 at 17:52
2

In its conventional orientation and aspect, which seems to be your case, the Miller cylindrical projection "touches" the globe along the equator, where there's no distortion, and each meridian behaves in exactly the same way regarding distortion (i.e., distortion increases away from the equator).

Thus, the central meridian's only purpose is to specify where the middle of the map is (in an east-west sense): keep it at zero and your map is centered on the prime meridian, make it +90 and the map is centered at 90 east, and so on.

Regarding your code: if your inputs are in degrees, they must be converted to radians first, or use 45 degrees (not pi/4) inside the tangent function.

Here's a ref: http://en.wikipedia.org/wiki/Miller_cylindrical_projection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.