1

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?

  • Are you talking about the geographical center of the mapped area (as per body of your Q)? Or the standard parallel of the projection (as per title of your Q)? And why do you need to know? Please edit the Q if necessary. – Martin F May 29 '14 at 15:36
  • I need to know the latitude of the middle point of the projected area. If I'm looking at a google map at a certain zoom, I only see a portion of the map. Computing the longitude from the east and west bounds of the view is easy, but I don't know an easy way of computing the latitude of the centre. Basically, I want to learn the way of computing the centre of a map bounds that are specified by S, W, N, E coordinates. – David May 29 '14 at 16:19
1

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

  • Now that i think about it, maybe you don't know the map coords of the map window? – Martin F May 29 '14 at 17:34
  • You're right - I don't know the coordinates and am looking for a way of computing the latitude of the center without having to compute the coordinates. – David May 29 '14 at 22:31
  • @David: What is the process/function/method of creating the mercator map -- really the portion of the mercator map, within a window? If my answer above is only the 2nd half of the problem, the 1st half must be "how to determine the map coordinates". – Martin F May 29 '14 at 23:08
  • Yes, actually, your answer above IS the 2nd half of the problem. My original question might not have been the brightest. What I was asking essentially was to simplify the expression that determines the coordinates, computes the centre and then computes the lat from it. – David Jun 2 '14 at 6:04
0

If you are using ArcGIS, you can use a cursor object and pass in the desired spatial reference on the geometry object.

with arcpy.da.SearchCursor(somedatapath, "SHAPE@", spatial_reference=arcpy.SpatialReference(4326)) as rows:
     for row in rows:
         print row[0].JSON # wow the data is in Lat/Long 

Just change the 4326 to what every coordinate system you want to project into.

  • Thanks for the tip, but I need to know the Math behind this. – David May 29 '14 at 16:21

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.