1
13693261870
2024-10-09 fc98146d74aad6caf4ab95a5932b5a8a355a94a3
src/main/java/com/se/simu/service/GedbService.java
@@ -18,6 +18,7 @@
import org.gdal.gdal.WarpOptions;
import org.gdal.gdal.gdal;
import org.gdal.gdalconst.gdalconst;
import org.gdal.osr.SpatialReference;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.client.RestTemplate;
@@ -217,9 +218,9 @@
        List<GeLayer> layers = getLayers(token, db);
        queryData(token, db, layers);
        createShps(basePath, layers);
        createZoneShp(basePath, data);
        createZoneShp(basePath, data, db.getSpatialReference());
        if (data.getPid() > 0) {
            createFloodShp(basePath, data);
            createFloodShp(basePath, data, db.getSpatialReference());
        }
    }
@@ -252,12 +253,18 @@
        return arr;
    }
    private void createZoneShp(String basePath, DataPo data) {
        //
    private void createZoneShp(String basePath, DataPo data, SpatialReference sr) {
        String filePath = basePath + File.separator + config.getZoneName();
        ShpHelper.createShp(filePath,null, sr, data.getMinx(), data.getMiny(), data.getMaxx(), data.getMaxy());
    }
    private void createFloodShp(String basePath, DataPo data) {
        //
    private void createFloodShp(String basePath, DataPo data, SpatialReference sr) {
        String filePath = basePath + File.separator + config.getBarrierName();
        Map<String, Object> map = new HashMap<>();
        map.put("height", data.getFloodHeight());
        map.put("type", data.getFloodType());
        ShpHelper.createShp(filePath, map, sr, data.getFloodMinx(), data.getFloodMiny(), data.getFloodMaxx(), data.getFloodMaxy());
    }
    public void copeDem(String token, DataPo data) throws Exception {