src/main/java/com/se/nsl/controller/TestController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/service/TestService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application-dev.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/se/nsl/controller/TestController.java
@@ -26,6 +26,9 @@ UwService uwService; @Resource TestService testService; @Resource GedbService gedbService; @Resource @@ -158,4 +161,21 @@ return fail(ex, null); } } @ApiOperation(value = "testNsl *") @GetMapping("/testNsl") public R<Object> testNsl() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20250412"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2025-04-12 00:00:00")); testService.test(data); return success("ok"); } catch (Exception ex) { return fail(ex, null); } } } src/main/java/com/se/nsl/service/TestService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,57 @@ package com.se.nsl.service; import cn.hutool.core.io.FileUtil; import com.se.nsl.config.PropertiesConfig; import com.se.nsl.domain.dto.LayerDto; import com.se.nsl.domain.dto.ResultDto; import com.se.nsl.domain.po.DataPo; import com.se.nsl.domain.vo.BuildingDepthVo; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.File; import java.util.List; @Slf4j @Service @SuppressWarnings("ALL") public class TestService { @Resource PropertiesConfig config; @Resource ResultService resultService; public void test(DataPo data) { String basePath = config.getInPath() + File.separator + data.getInPath() + File.separator; ResultDto dto = new ResultDto( data.getInPath(), basePath + config.getTerrainFile(), basePath + config.getBuildingFile(), basePath + config.getWaterPath(), basePath + config.getFlowPath(), config.getInPath(), config.getOutPath(), data.getEpsg()); LayerDto layer = new LayerDto(config.getVer(), data.getEpsg(), config.getSizes()); process(dto, layer); } private void process(ResultDto dto, LayerDto layer) { try { // copeTerrain(dto, layer); // copeBuilding(dto, layer); // List<BuildingDepthVo> buildings = copeWater(dto, layer); // copeFlow(dto, layer); // copeLayerJson(dto, layer); // copeRainFallJson(dto, layer); // copeBuildingDepthJson(dto, buildings); } finally { File dir = new File(dto.getTemp()); if (dir.exists()) { FileUtil.del(dir); } } } } src/main/resources/application-dev.yml
@@ -105,16 +105,16 @@ # 模æé¡¹ç® simu-app: # é¡¹ç®æ¨¡ææä»¶ä¸ä¼ åæ¾çä½ç½® filePath: D:\simu\files filePath: D:\other\simu\files config: ver: 0.2 cacheTime: 60 # Gdal驱å¨ç®å½ gdalPath: D:\gdal\release-1928-x64-dev\release-1928-x64\bin gdalPath: D:\soft\release-1928-x64-dev\release-1928-x64\bin #inPath: D:\simu\in inPath: D:\uwsolver outPath: D:\out inPath: D:\other\simu\uwsolver outPath: D:\other\simu\out host: http://106.120.22.26:8024/ user: admin pwd: admin @@ -138,8 +138,8 @@ rainPeriod: 10 # æµéåä½ï¼LPSï¼å/ç§ï¼ãCMSï¼ç«æ¹ç±³/ç§)ãCFS(ç«æ¹è±å°º/ç§) flowUnits: CMS solverBat: D:\uwsolver\run_solver.bat sww2tifBat: D:\uwsolver\sww2tif.bat solverBat: D:\other\simu\uwsolver\run_solver.bat sww2tifBat: D:\other\simu\uwsolver\sww2tif.bat sizes: 64,128,256,512,1024,2048 # è¾åºæä»¶ terrainFile: DEM.tif @@ -149,4 +149,4 @@ waterPath: depth flowPath: velocity copyTif: false tifPath: D:\åå¸å æ¶\sem\tongzhou_1m_tif\tongzhou_raster_4548_1m_clip_river_fill.tif tifPath: D:\other\simu\uwsolver\5ca43c87cd8e48c5a9c5399a5da46dbc\tongzhou_raster_4548_1m_clip_river_fill.tif