0


python 经纬度墨卡托互转

def marcator(x,y):
lonlat = {}
xx = x/ 20037508.3427892 * 180
yy = y/ 20037508.3427892 * 180
lonlat['x'] = xx
lonlat['y'] = 180 / math.pi * (2 * math.atan(math.exp(yy * math.pi / 180)) - math.pi / 2)
return lonlat

经纬度转墨卡托

def marcatorxy(x,y):
marcator = {}
xx = x/180*20037508.3427892
yy = math.log(math.tan((90 + y) * math.pi / 360))/(math.pi / 180)
marcator['x'] = xx
marcator['y'] = yy * 20037508.34 / 180
return marcator

标签: python

本文转载自: https://blog.csdn.net/fudacaitao/article/details/123093688
版权归原作者 小小愚公 所有, 如有侵权,请联系我们删除。

“python 经纬度墨卡托互转”的评论:

还没有评论