11
13693261870
2024-11-11 138b959cc11dc9a73b0c766030b99ba1180d8650
src/main/java/com/se/simu/service/ResultService.java
@@ -34,12 +34,6 @@
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
 * 处理结果服务类
 *
 * @author WWW
 * @date   2024-09-29
 */
@Slf4j
@Service
@SuppressWarnings("ALL")
@@ -82,9 +76,6 @@
        }
    }
    /**
     * 地形
     */
    private void copeTerrain(ResultDto dto, LayerDto layer) {
        Dataset ds = null;
        try {
@@ -138,9 +129,6 @@
        }
    }
    /**
     * 重采样: https://blog.51cto.com/u_16099346/6691820
     */
    private static void Resample(Dataset ds, String dest, int width, int height, LayerDto layer) {
        Vector<String> vector = new Vector<>();
        //vector.add("-s_srs");
@@ -224,9 +212,6 @@
        }
    }
    /**
     * 建筑
     */
    private void copeBuilding(ResultDto dto, LayerDto layer) {
        Driver driver = null;
        DataSource dataSource = null;
@@ -256,9 +241,6 @@
        }
    }
    /**
     * 水面
     */
    private void setWaterInfo(ResultDto dto, LayerDto layer) {
        List<String> files = getFiles(dto.getWaterPath(), ".tif");
        layer.getWaters().setFiles(files);
@@ -434,10 +416,6 @@
        }
    }
    /**
     * 是否相交
     * https://blog.csdn.net/flyingshineangel/article/details/135423025
     */
    private static BuildingDto intersects(ResultDto dto, double x, double y) {
        Geometry p = new Geometry(ogr.wkbPoint);
        p.AddPoint_2D(x, y);
@@ -566,7 +544,6 @@
    private static void createFlowPng(float[] vxBuffer, float[] vyBuffer, String png, int width, int height) {
        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        // 用 R通道表示,流向为归一化的二维向量(x,y),G通道表示为 x *255 , B通道表示为 y * 255
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                int offset = x + y * width;
@@ -600,9 +577,6 @@
        return val;
    }
    /**
     * 元数据
     */
    private void copeLayerJson(ResultDto dto, LayerDto layer) throws IOException {
        layer.getWaters().setFiles(null);
        layer.getTerrain().setEpsg(null);
@@ -614,9 +588,6 @@
        writeJson(filePath, json);
    }
    /**
     * 处理降水曲线文件曲线图
     */
    public void copeRainFallJson(ResultDto dto, LayerDto layer) throws IOException, ParseException {
        String rainGageFilePath = config.getInPath() + File.separator + dto.getServiceName() + File.separator + "RainGage.dat";
        String filePath = dto.getOutPath() + File.separator + "rainfall.json";