






















http://rovertang.com/labs/tileindex/
国内的经纬度有三套系统:
使用OpenStreetMap的坐标为WGS84;使用高德地图、腾讯地图的坐标为GCJ02;使用百度地图的坐标为BD09;谷歌地图和Bing地图的中国部分采用了高德地图的数据,所以坐标为GCJ02。
WGS84的坐标转化为GCJ02的坐标是单向的,即WGS84的坐标能够准确地变换为GCJ02坐标;但GCJ02坐标转换为WGS84时会存在精度损失。
GCJ02的坐标和BD09的坐标转换是双向的,转换规则可以参考下面的python代码:
import math x_pi = 3.14159265358979324 * 3000.0 / 180.0 def amapcoor2bmapcoor(amap_lon, amap_lat): x = amap_lon y = amap_lat z = math.sqrt(x * x + y * y) + 0.00002 * math.sin(y * x_pi) theta = math.atan2(y, x) + 0.000003 * math.cos(x * x_pi) bmap_lon = z * math.cos(theta) + 0.0065 bmap_lat = z * math.sin(theta) + 0.006 return (bmap_lon, bmap_lat) def bmapcoor2amapcoor(bmap_lon, bmap_lat): x = bmap_lon - 0.0065 y = bmap_lat - 0.006; z = math.sqrt(x * x + y * y) - 0.00002 * math.sin(y * x_pi); theta = math.atan2(y, x) - 0.000003 * math.cos(x * x_pi); amap_lon = z * math.cos(theta); amap_lat = z * math.sin(theta); return (amap_lon, amap_lat)https://github.com/geometalab/pyGeoTile
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。