I have an image of (what I believe to be) a Mercator Projection map of Strangereal, from the Ace Combat game series. I have opened this map in GIMP and am reading pixel measurements for different locations. Ignoring the borders, the upper-left corner is (28, 28) and the lower-right corner is (9771, 5628). The equator is at y = 2818.

I am trying to take a given pixel measurement, say, Sand Island (3991, 2579), and convert it to latitude and longitude.

I know that the formulas for a Mercator projection are

$x = \lambda - \lambda_0$, $y = \log \tan(\pi/4 + \phi/2)$

$\phi = 2\arctan e^y - \pi/2$, $\lambda = x + \lambda_0$

where $\lambda$ is longitude, $\lambda_0$ is central meridian, $\phi$ is latitude, and $y=0$ is the equator.

Longitude is pretty simple: this map uses the left edge as 0 degrees and counts up to 360 degrees east. $\lambda = \frac{(3991-28)}{(9771-28)} \times 360^\circ = 146^\circ 25' 52'' \text{ E}$.

My problem is the latitude. With the equator at y = 2818, Sand Island is 239 pixels about the equator (or about 8.5% from the equator to the top of the map). What should I plug into the equation $\phi = 2\arctan \exp y - \pi/2$ to find its latitude?

(For reference, the "official" coordinates for Sand Island are $08^\circ 01' 13'' \text{ N, } 145^\circ 24' 34'' \text{ E}$, but the coordinate system is rough and inconsistent. That's why I'm doing the math myself. That, and I want other points on the earth.)


I suspect the answer lies in the fact that Mercator is isotropic - i.e. at any point the scale is the same in x as in y.

At the equator, you therefore know the scale in pixels / metre as total pixels / earth circumference, and can use this to calculate the distance from a pixel on the equator to the next northmost.

Calculate the latitude that is that far north of the equator, which will give you a new scale based on the width now representing the parallel circumference of 2 * pi * radius * cos(lat), and so on...

Of course doing this in GIMP manually will be very tedious, but you could readily write a programme to use this algorithm to convert the image into a Plate Carrée / Equirectangular projection which would be trivially simple to measure in GIMP...


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.