liujie
2026-02-24 0101847a5bb828bf7b97922bc55898ad3cb7669f
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -5,6 +5,7 @@
import com.alibaba.fastjson.JSONObject;
import com.xiaopeng.api.dto.operation.LonLatDto;
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;
@@ -24,7 +25,7 @@
@Lazy
public class GDMapGeocodingUtil {
    private String key = "f11b217cdbb08cd780919ed7398c5504";
    private String key = "66ae577f63898dae3016d599fda57221";
    @Autowired
    private RestTemplate restTemplate;
@@ -54,18 +55,22 @@
        params.put("start", start.getLongitude() + "," + start.getLatitude());
        params.put("end", end.getLongitude() + "," + end.getLatitude());
        params.put("routeUserType",2);
        params.put("voidPolygons", avoidRoads);
        if(avoidRoads!=null && !avoidRoads.isEmpty()){
            params.put("voidPolygons", avoidRoads);
        }
        if(routePlanRule!=null){
            params.put("strategy", routePlanRule);
        }
        String forObject = restTemplate.getForObject(url, String.class, params);
        JSONObject jsonObject = JSON.parseObject(forObject);
        String post = HttpUtils.post(url, JSON.toJSONString(params));
        System.out.println("高德地图返回结果:"+ post);
//        String forObject = restTemplate.getForObject(url, String.class, params);
        JSONObject jsonObject = JSON.parseObject(post);
        String data = jsonObject.getString("data");
        JSONObject jsonObject1 = JSON.parseObject(data);
        String routeID = jsonObject1.getString("routeID");
        JSONArray path = jsonObject1.getJSONArray("path");
        JSONArray path = jsonObject1.getJSONArray("paths");
        for (Object o : path) {
            JSONObject jsonObject2 = (JSONObject) o;