| | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> geocoding(String address) throws Exception{ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | public Map<String, String> geocode1(String lon, String lan) throws Exception{ |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | |
| | | |
| | | /** |
| | | * 坐标转换 |
| | | * |
| | | * @param locations 经度和纬度用","分割,经度在前,纬度在后,经纬度小数点后不得超过6位。多个坐标对之间用”|”进行分隔最多支持40对坐标。 |
| | | * @param coordsys 可选值:gps;mapbar;baidu;autonavi(不进行转换) |
| | | * @return |