[GIS] Compute the latitude of a center of mercator projection

latitude longitudemercator

Say I'm looking at a portion of a map that's displayed using Mercator projection with the view bounded at 40°N and 20°N. How do I compute the latitude of the point that's in the centre of that view?

I figured it's not 30° and can compute it by firstly projecting the bounding latitudes onto a square using Mercator, computing the middle point, and then projecting back onto a sphere. But is there a simpler way of achieving the same without having to project to and from Mercator?

Best Answer

Assuming you know the map coordinates of the center -- from those of the top and bottom of the map window -- the problem is called inverse (or reverse) map projection.

From wikipedia: Mercator projection, The spherical model:

latitude = 2 arctan ( exp [y / R]) - pi/2

where y = map coordinates of the center
and R = earth radius