| | |
| | | * 调用zarr2tif |
| | | */ |
| | | private String callZarr2tif(SimuData data) throws Exception { |
| | | String zarr2tifBat = config.getZarr2tifBat(); |
| | | File dir = new File(zarr2tifBat).getParentFile(); |
| | | String configJson = new File(dir, "config.json").getAbsolutePath(); |
| | | |
| | | String cmd = String.format("%s \"%s\"", zarr2tifBat, configJson); |
| | | String res = callBat(cmd); |
| | | |
| | | File resultTifDir = new File(dir, "result_tif"); |
| | | File targetDir = new File(config.getInPath(), data.getInPath() + File.separator + "depth"); |
| | | System.out.println("targetDir:" + targetDir); |
| | | File[] files = resultTifDir.listFiles(); |
| | | for (File file : files) { |
| | | File target = new File(targetDir, file.getName()); |
| | | Files.copy(file.toPath(), target.toPath()); |
| | | } |
| | | |
| | | return res; |
| | | } |
| | | |
| | | /*private String callZarr2tif(SimuData data) throws Exception { |
| | | File uwBat = new File(config.getUwSolverBat()); |
| | | String zarrFile = uwBat.getParent() + File.separator + "result.zarr"; |
| | | String inPath = config.getInPath() + File.separator + data.getInPath(); |
| | |
| | | String cmd = String.format("%s \"%s\" \"%s\" \"%s\" \"%s\"", config.getZarr2tifBat(), "depth", zarrFile, terrainFile, waterPath); |
| | | |
| | | return callBat(cmd); |
| | | } |
| | | }*/ |
| | | |
| | | private String callBat(String cmd) { |
| | | try { |