13693261870
2024-09-23 2d8912ef7f64f86553e480e31e2c60d18bb86bdf
src/main/java/com/se/simu/service/GedbService.java
@@ -100,7 +100,7 @@
        String filePath = inPath + File.separator + fileDb.getDbid();
        downloadFiles(token, filePath, files, fileDb.getDbid(), fileId);
        clipDemFile(filePath, files, basePath, bbox, 4528);
        clipDemFile(filePath, files, basePath, bbox, 4548);
        return true;
    }
@@ -334,7 +334,7 @@
    }
    private void clipDemFile(String filePath, List<GeFile> files, String basePath, String bbox, int epsg) throws Exception {
        String target = basePath + File.separator + demName;
        String target = basePath + File.separator + demFile;
        for (GeFile file : files) {
            if (file.getName().toLowerCase().endsWith(demType)) {
                String source = filePath + File.separator + file.getName();
@@ -353,9 +353,6 @@
            // String bbox = "116.64388473935195,39.884315914604464,116.64754729082588,39.887069143903496";
            String[] bb = bbox.split(",");
            // gdalwarp -ot UInt16 -s_srs EPSG:4326 -t_srs EPSG:2382 -r bilinear -of GTiff -te 116.526854182 40.0481829856 116.532848182 40.0541769856
            // -te_srs EPSG:4326 -co COMPRESS=DEFLATE -co PREDICTOR=1 -co ZLEVEL=6 -co TILED=YES -wo OPTIMIZE_SIZE=TRUE E:\GDALhomework\000002.tif E:/CSDN/warped1.tif
            Vector<String> vector = new Vector<>();
            //vector.add("-s_srs");
            //vector.add("EPSG:" + 4326);
@@ -372,9 +369,11 @@
            vector.add(bb[3]);
            vector.add("-te_srs");
            vector.add("EPSG:" + 4326);
            WarpOptions warpOptions = new WarpOptions(vector);
            // gdalwarp -ot UInt16 -s_srs EPSG:4326 -t_srs EPSG:2382 -r bilinear -of GTiff -te 116.526854182 40.0481829856 116.532848182 40.0541769856
            // -te_srs EPSG:4326 -co COMPRESS=DEFLATE -co PREDICTOR=1 -co ZLEVEL=6 -co TILED=YES -wo OPTIMIZE_SIZE=TRUE E:\GDALhomework\000002.tif E:/CSDN/warped1.tif
            Dataset destDs = gdal.Warp(target, new Dataset[]{ds}, warpOptions);
            destDs.delete();
        } finally {