墨卡托投影略有偏离 - python

我正在建立一个需要大量Google地图图像的项目。我将这些功能定义为在另一个将自动收集图像的功能中使用。纬度变化很好,但我注意到经度略有下降。那是墨卡托近似投影方法的伪像吗?我的印象是,我使用的转换非常准确,除了接近两极。

import math
import os
import DLMaps
#Finds the distance covered in a Static Maps image pixel
def PixDist(zoom,scale=2):
    earthCirc = 40075.0 #in Km's
    base = 256 #size of google maps at zoom = 0
    return earthCirc/(base*scale*(2**zoom))

#Finds the Km distance to the next google static maps image based on size of images,
# and distance per pixel
def DistNextImage(distpp, scale=2, size=640):
    return distpp*scale*size

#returns a new Lat, Lon co-ordinate given a starting point, km distance change and
# a NESW direction, values 1-4 being used to represent corresponding direction.
def NewLatLon(lat,lon, dist, direction):
    if direction==1:
        dist = dist/110.54 #approximate change in latitude mercator projection
        lat = lat + dist #heading north
    elif direction == 2:
        dist = dist/(110.32 * math.cos(math.pi*lat/180.0)) #approx change in lon
        lon = lon + dist
    elif direction==3:
        dist = dist/110.54 #approximate change in latitude mercator projection
        lat = lat - dist #heading south
    elif direction ==4:
        dist = dist/(110.32 * math.cos(math.pi*lat/180.0)) #approx change in lon
        lon = lon - dist
    return lat, lon

python大神给出的解决方案

地球不是真正的椭球,坐标系统很多,从一个系统传递到另一个系统绝非易事。您可以看一下pyproj与著名的proj.4库的Python接口,以将Lat-Lon(我假设为WGS84 ...)转换为几乎所有其他坐标,当然包括Mercator。您可以尝试自己动手,但是有很多警告,例如不同来源的子午线,参考椭球的细微差别,以致您几乎没有希望获得正确和准确的结果。

但是您在wikipedia的WGS84上有一些参考资料