1
13693261870
2024-11-02 e46790ae4ba029027d4d7784655b8a90234968ba
src/main/java/com/se/simu/service/ResultService.java
@@ -18,6 +18,7 @@
import org.gdal.gdalconst.gdalconst;
import org.gdal.ogr.*;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
@@ -56,7 +57,8 @@
                basePath + config.getBuildingFile(),
                basePath + config.getWaterPath(),
                basePath + config.getFlowPath(),
                config.getOutPath());
                config.getOutPath(),
                data.getEpsg());
        LayerDto layer = new LayerDto(config.getVer(), data.getEpsg(), config.getSizes());
        process(dto, layer);
    }
@@ -349,6 +351,7 @@
            try {
                ds = gdal.Open(files.get(i), gdalconst.GA_ReadOnly);
                if (null == ds || 0 == ds.getRasterCount()) return;
                if (null == ds.GetSpatialRef()) ds.SetSpatialRef(dto.getSpatialReference());
                createWaterPng(dto, ds, layer, layer.getWaters().getData().get(i));
                copyWaterTif(dto, ds, layer.getWaters().getData().get(i));
@@ -447,6 +450,7 @@
            try {
                ds = gdal.Open(files.get(i), gdalconst.GA_ReadOnly);
                if (null == ds || 0 == ds.getRasterCount()) return;
                if (null == ds.GetSpatialRef()) ds.SetSpatialRef(dto.getSpatialReference());
                createFlowPng(dto, ds, layer, layer.getWaters().getData().get(i));
            } finally {
@@ -565,6 +569,8 @@
    }
    private void copeBuildingDepthJson(ResultDto dto, List<BuildingDepthVo> list) throws IOException {
        if (CollectionUtils.isEmpty(list)) return;
        String json = JSON.toJSONString(list);
        String filePath = dto.getOutPath() + File.separator + "building.json";