Web墨卡托平面坐标系转84坐标系(经纬度)
import math
import json
geojson ={
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
596461.703,
4294428.963
],
[
687371.885,
4296710.895
],
[
682376.833,
4296942.36
],
[
596461.703,
4294428.963
]
]
},
"properties": {
}
}
]
}
def web_mercator_to_wgs84(x, y):
lon = x * 180 / 20037508.34
lat = 180 / math.pi * (2 * math.atan(math.exp(y * math.pi / 20037508.34)) - math.pi / 2)
return lon,