liujie
2026-02-27 2b8beecbaebd0409ad6f3a8be95a7db21880f738
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -7,16 +7,12 @@
import com.xiaopeng.api.vo.operation.RouteVo;
import com.xiaopeng.common.core.utils.HttpUtils;
import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService;
import com.xiaopeng.map.utils.mangoUtils.MongoGeoFenceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 高德地图的地理编码工具类
@@ -27,9 +23,7 @@
    private String key = "66ae577f63898dae3016d599fda57221";
    @Autowired
    private RestTemplate restTemplate;
    @Autowired
    private XpGeoFencingPolygonService xpGeoFencingPolygonService;
@@ -69,11 +63,10 @@
        String data = jsonObject.getString("data");
        JSONObject jsonObject1 = JSON.parseObject(data);
        String routeID = jsonObject1.getString("routeID");
        JSONArray path = jsonObject1.getJSONArray("paths");
        for (Object o : path) {
            JSONObject jsonObject2 = (JSONObject) o;
            String routeID = jsonObject2.getString("routeID");
            String points = jsonObject2.getString("points");
            String[] split = points.split(";");
            int temp=0;
@@ -120,7 +113,7 @@
        String url = "https://tsapi.amap.com/v1/route/query/routeid?key=" + key;
        HashMap<String, Object> params = new HashMap<>();
        params.put("routeID", routeID);
        params.put("sdkVersion", "");
        params.put("sdkVersion", "9.850.152.3.532");
        params.put("encoderVersion", "5.1");
        String post = HttpUtils.post(url, JSON.toJSONString(params));
        System.out.println("高德地图返回结果:"+ post);