一、坐标分类
地图坐标大致分为几种:
1、GPS、WGS84,也就是原始坐标体系,这是国际公认的世界标准坐标体系;
2、GCJ-02,又称为“火星坐标”,国家测绘局在02年发布的坐标体系,在国内,至少得使用此坐标体系,比如:google、高德、腾讯地图等;
3、其他特殊坐标体系,一般都是由火星坐标通过偏移算法计算得出的,比如百度使用的是BD-09坐标,搜狗使用的是自己的搜狗坐标。
二、坐标转换
1、使用高德地图sdk转换
public AMapLocation fromGpsToAmap(Location location) {
AMapLocation aMapLocation = new AMapLocation(location);
CoordinateConverter converter = new CoordinateConverter(mContext);
converter.from(CoordinateConverter.CoordType.GPS);
try {
converter.coord(new DPoint(location.getLatitude(), location.getLongitude()));
DPoint desLatLng = converter.convert();
aMapLocation.setLatitude(desLatLng.getLatitude());
aMapLocation.setLongitude(desLatLng.getLongitude());
} catch (Exception e) {