| | |
| | | |
| | | select id,name,service_name,type,area_type,area_name,status,result,create_time,update_time,bak,data,st_astext(geom) from nsl.simu where id > 0 order by id desc; |
| | | -- update nsl.simu set status=0,area_name='æ¿å±±åº',result=null,data = '{"startTime":"2025-05-01 11:10:54","type":3,"total":50,"duration":6,"intensity":70,"history":"XXå¹´50mméé¨"}' where id = 17; |
| | | -- update nsl.simu set status=0,area_name='æ¿å±±åº',result=null,data = '{"startTime":"2025-05-06 14:31:58","type":3,"total":1025,"duration":96,"intensity":78.5,"rainfalls":[{"time":"2023-07-29 22:00:00","intensity":2,"total":2},{"time":"2023-07-29 23:00:00","intensity":2,"total":4},{"time":"2023-07-30 00:00:00","intensity":3.5,"total":7.5},{"time":"2023-07-30 01:00:00","intensity":2.5,"total":10},{"time":"2023-07-30 02:00:00","intensity":2,"total":244.5},{"time":"2023-07-30 03:00:00","intensity":3.5,"total":339.5},{"time":"2023-07-30 04:00:00","intensity":6,"total":345.5},{"time":"2023-07-30 05:00:00","intensity":10.5,"total":356},{"time":"2023-07-30 06:00:00","intensity":4.5,"total":360.5},{"time":"2023-07-30 07:00:00","intensity":5.5,"total":366},{"time":"2023-07-30 08:00:00","intensity":13,"total":379},{"time":"2023-07-30 09:00:00","intensity":17,"total":396},{"time":"2023-07-30 10:00:00","intensity":15.5,"total":25.5},{"time":"2023-07-30 11:00:00","intensity":17.5,"total":43},{"time":"2023-07-30 12:00:00","intensity":16,"total":59},{"time":"2023-07-30 13:00:00","intensity":18.5,"total":77.5},{"time":"2023-07-30 14:00:00","intensity":13,"total":90.5},{"time":"2023-07-30 15:00:00","intensity":23.5,"total":114},{"time":"2023-07-30 16:00:00","intensity":28.5,"total":142.5},{"time":"2023-07-30 17:00:00","intensity":24.5,"total":167},{"time":"2023-07-30 18:00:00","intensity":43,"total":210},{"time":"2023-07-30 19:00:00","intensity":32.5,"total":242.5},{"time":"2023-07-30 20:00:00","intensity":49.5,"total":294},{"time":"2023-07-30 21:00:00","intensity":18.5,"total":312.5},{"time":"2023-07-30 22:00:00","intensity":8,"total":320.5},{"time":"2023-07-30 23:00:00","intensity":15.5,"total":336},{"time":"2023-07-31 00:00:00","intensity":12.5,"total":408.5},{"time":"2023-07-31 01:00:00","intensity":15,"total":423.5},{"time":"2023-07-31 02:00:00","intensity":4,"total":537},{"time":"2023-07-31 03:00:00","intensity":12,"total":647},{"time":"2023-07-31 04:00:00","intensity":5,"total":652},{"time":"2023-07-31 05:00:00","intensity":36.5,"total":688.5},{"time":"2023-07-31 06:00:00","intensity":18,"total":706.5},{"time":"2023-07-31 07:00:00","intensity":26,"total":732.5},{"time":"2023-07-31 08:00:00","intensity":38,"total":770.5},{"time":"2023-07-31 09:00:00","intensity":39.5,"total":810},{"time":"2023-07-31 10:00:00","intensity":38,"total":461.5},{"time":"2023-07-31 11:00:00","intensity":27,"total":488.5},{"time":"2023-07-31 12:00:00","intensity":5.5,"total":494},{"time":"2023-07-31 13:00:00","intensity":2.5,"total":496.5},{"time":"2023-07-31 14:00:00","intensity":4,"total":500.5},{"time":"2023-07-31 15:00:00","intensity":8,"total":508.5},{"time":"2023-07-31 16:00:00","intensity":8.5,"total":517},{"time":"2023-07-31 17:00:00","intensity":0.5,"total":517.5},{"time":"2023-07-31 18:00:00","intensity":10,"total":527.5},{"time":"2023-07-31 19:00:00","intensity":5.5,"total":533},{"time":"2023-07-31 20:00:00","intensity":20.5,"total":557.5},{"time":"2023-07-31 21:00:00","intensity":25,"total":582.5},{"time":"2023-07-31 22:00:00","intensity":25.5,"total":608},{"time":"2023-07-31 23:00:00","intensity":27,"total":635},{"time":"2023-08-01 00:00:00","intensity":78.5,"total":888.5},{"time":"2023-08-01 01:00:00","intensity":32.5,"total":921},{"time":"2023-08-01 02:00:00","intensity":9.5,"total":956.5},{"time":"2023-08-01 03:00:00","intensity":6.5,"total":981.5},{"time":"2023-08-01 04:00:00","intensity":22.5,"total":1004},{"time":"2023-08-01 05:00:00","intensity":1,"total":1005},{"time":"2023-08-01 06:00:00","intensity":0,"total":1005},{"time":"2023-08-01 07:00:00","intensity":8,"total":1013},{"time":"2023-08-01 08:00:00","intensity":6,"total":1019},{"time":"2023-08-01 09:00:00","intensity":5.5,"total":1024.5},{"time":"2023-08-01 10:00:00","intensity":3,"total":924},{"time":"2023-08-01 11:00:00","intensity":5.5,"total":929.5},{"time":"2023-08-01 12:00:00","intensity":8.5,"total":938},{"time":"2023-08-01 13:00:00","intensity":8,"total":946},{"time":"2023-08-01 14:00:00","intensity":0.5,"total":946.5},{"time":"2023-08-01 16:00:00","intensity":0,"total":946.5},{"time":"2023-08-01 18:00:00","intensity":0.5,"total":947},{"time":"2023-08-01 20:00:00","intensity":17,"total":973.5},{"time":"2023-08-01 21:00:00","intensity":1,"total":974.5},{"time":"2023-08-01 22:00:00","intensity":0.5,"total":975},{"time":"2023-08-02 00:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 02:00:00","intensity":0,"total":1025},{"time":"2023-08-02 03:00:00","intensity":0.5,"total":1025.5},{"time":"2023-08-02 04:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 06:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 08:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 12:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 14:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 15:00:00","intensity":0.5,"total":1025},{"time":"2023-08-02 18:00:00","intensity":0,"total":1025},{"time":"2023-08-02 20:00:00","intensity":0,"total":1025},{"time":"2023-08-02 22:00:00","intensity":0,"total":1025}]}' where id = 17; |
| | | -- update nsl.simu set status=0,area_name='æ¿å±±åº',result=null,data = '{"startTime":"2025-05-06 14:31:58","type":3,"total":1025,"duration":14,"intensity":78.5,"rainfalls":[{"time":"2023-07-29 22:00:00","intensity":2,"total":2},{"time":"2023-07-29 23:00:00","intensity":2,"total":4},{"time":"2023-07-30 00:00:00","intensity":3.5,"total":7.5},{"time":"2023-07-30 01:00:00","intensity":2.5,"total":10},{"time":"2023-07-30 02:00:00","intensity":2,"total":244.5},{"time":"2023-07-30 03:00:00","intensity":3.5,"total":339.5},{"time":"2023-07-30 04:00:00","intensity":6,"total":345.5},{"time":"2023-07-30 05:00:00","intensity":10.5,"total":356},{"time":"2023-07-30 06:00:00","intensity":4.5,"total":360.5},{"time":"2023-07-30 07:00:00","intensity":5.5,"total":366},{"time":"2023-07-30 08:00:00","intensity":13,"total":379},{"time":"2023-07-30 09:00:00","intensity":17,"total":396},{"time":"2023-07-30 10:00:00","intensity":15.5,"total":25.5},{"time":"2023-07-30 11:00:00","intensity":17.5,"total":43},{"time":"2023-07-30 12:00:00","intensity":16,"total":59},{"time":"2023-07-30 13:00:00","intensity":18.5,"total":77.5},{"time":"2023-07-30 14:00:00","intensity":13,"total":90.5},{"time":"2023-07-30 15:00:00","intensity":23.5,"total":114},{"time":"2023-07-30 16:00:00","intensity":28.5,"total":142.5},{"time":"2023-07-30 17:00:00","intensity":24.5,"total":167},{"time":"2023-07-30 18:00:00","intensity":43,"total":210},{"time":"2023-07-30 19:00:00","intensity":32.5,"total":242.5},{"time":"2023-07-30 20:00:00","intensity":49.5,"total":294},{"time":"2023-07-30 21:00:00","intensity":18.5,"total":312.5},{"time":"2023-07-30 22:00:00","intensity":8,"total":320.5},{"time":"2023-07-30 23:00:00","intensity":15.5,"total":336},{"time":"2023-07-31 00:00:00","intensity":12.5,"total":408.5},{"time":"2023-07-31 01:00:00","intensity":15,"total":423.5},{"time":"2023-07-31 02:00:00","intensity":4,"total":537},{"time":"2023-07-31 03:00:00","intensity":12,"total":647},{"time":"2023-07-31 04:00:00","intensity":5,"total":652},{"time":"2023-07-31 05:00:00","intensity":36.5,"total":688.5},{"time":"2023-07-31 06:00:00","intensity":18,"total":706.5},{"time":"2023-07-31 07:00:00","intensity":26,"total":732.5},{"time":"2023-07-31 08:00:00","intensity":38,"total":770.5},{"time":"2023-07-31 09:00:00","intensity":39.5,"total":810},{"time":"2023-07-31 10:00:00","intensity":38,"total":461.5},{"time":"2023-07-31 11:00:00","intensity":27,"total":488.5},{"time":"2023-07-31 12:00:00","intensity":5.5,"total":494},{"time":"2023-07-31 13:00:00","intensity":2.5,"total":496.5},{"time":"2023-07-31 14:00:00","intensity":4,"total":500.5},{"time":"2023-07-31 15:00:00","intensity":8,"total":508.5},{"time":"2023-07-31 16:00:00","intensity":8.5,"total":517},{"time":"2023-07-31 17:00:00","intensity":0.5,"total":517.5},{"time":"2023-07-31 18:00:00","intensity":10,"total":527.5},{"time":"2023-07-31 19:00:00","intensity":5.5,"total":533},{"time":"2023-07-31 20:00:00","intensity":20.5,"total":557.5},{"time":"2023-07-31 21:00:00","intensity":25,"total":582.5},{"time":"2023-07-31 22:00:00","intensity":25.5,"total":608},{"time":"2023-07-31 23:00:00","intensity":27,"total":635},{"time":"2023-08-01 00:00:00","intensity":78.5,"total":888.5},{"time":"2023-08-01 01:00:00","intensity":32.5,"total":921},{"time":"2023-08-01 02:00:00","intensity":9.5,"total":956.5},{"time":"2023-08-01 03:00:00","intensity":6.5,"total":981.5},{"time":"2023-08-01 04:00:00","intensity":22.5,"total":1004},{"time":"2023-08-01 05:00:00","intensity":1,"total":1005},{"time":"2023-08-01 06:00:00","intensity":0,"total":1005},{"time":"2023-08-01 07:00:00","intensity":8,"total":1013},{"time":"2023-08-01 08:00:00","intensity":6,"total":1019},{"time":"2023-08-01 09:00:00","intensity":5.5,"total":1024.5},{"time":"2023-08-01 10:00:00","intensity":3,"total":924},{"time":"2023-08-01 11:00:00","intensity":5.5,"total":929.5},{"time":"2023-08-01 12:00:00","intensity":8.5,"total":938},{"time":"2023-08-01 13:00:00","intensity":8,"total":946},{"time":"2023-08-01 14:00:00","intensity":0.5,"total":946.5},{"time":"2023-08-01 16:00:00","intensity":0,"total":946.5},{"time":"2023-08-01 18:00:00","intensity":0.5,"total":947},{"time":"2023-08-01 20:00:00","intensity":17,"total":973.5},{"time":"2023-08-01 21:00:00","intensity":1,"total":974.5},{"time":"2023-08-01 22:00:00","intensity":0.5,"total":975},{"time":"2023-08-02 00:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 02:00:00","intensity":0,"total":1025},{"time":"2023-08-02 03:00:00","intensity":0.5,"total":1025.5},{"time":"2023-08-02 04:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 06:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 08:00:00","intensity":0,"total":1025.5},{"time":"2023-08-02 12:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 14:00:00","intensity":0,"total":1024.5},{"time":"2023-08-02 15:00:00","intensity":0.5,"total":1025},{"time":"2023-08-02 18:00:00","intensity":0,"total":1025},{"time":"2023-08-02 20:00:00","intensity":0,"total":1025},{"time":"2023-08-02 22:00:00","intensity":0,"total":1025}]}' where id = 17; |
| | | ---------------------------------------------- 2.æ¨æ¼åºå |
| | | -- drop table if exists nsl.region; |
| | | create table nsl.region ( |
| | |
| | | package com.se.nsl.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.se.nsl.config.PropertiesConfig; |
| | | import com.se.nsl.domain.po.DataPo; |
| | | import com.se.nsl.domain.po.Region; |
| | | import com.se.nsl.domain.po.Simu; |
| | | import com.se.nsl.domain.po.SimuData; |
| | | import com.se.nsl.domain.vo.R; |
| | | import com.se.nsl.helper.GdalHelper; |
| | |
| | | |
| | | @Resource |
| | | PropertiesConfig config; |
| | | |
| | | @Resource |
| | | SimuService simuService; |
| | | |
| | | @Resource |
| | | ResolveService resolveService; |
| | |
| | | //rs = resolveService.createRainfallCsv("D:\\360\\bdpj.csv", "æ³¢å¨å¹³ååå¸", 100, 10, 1); |
| | | //rs = resolveService.createRainfallCsv("D:\\360\\cxss.csv", "æç»ä¸å", 100, 10, 1); |
| | | |
| | | SimuData data = new SimuData(); |
| | | data.setStartTime(new Date()); |
| | | data.setInPath("20250504203823"); |
| | | //SimuData data = new SimuData(); |
| | | //data.setStartTime(new Date()); |
| | | //data.setInPath("20250504203823"); |
| | | //String rs = resolveService.callZarr2tif(data); |
| | | |
| | | String rs = resolveService.callZarr2tif(data); |
| | | Simu simu = simuService.selectById(17); |
| | | SimuData data = JSON.parseObject(simu.getData(), SimuData.class); |
| | | resolveService.initArgs(data); |
| | | resolveService.createRainfallFile(simu, data); |
| | | resolveService.callUwSolver(data); |
| | | |
| | | return (Object) System.currentTimeMillis(); |
| | | } |
| | |
| | | |
| | | private Integer kSt; |
| | | |
| | | private Integer initial_depth; |
| | | |
| | | private Integer initial_xmomentum; |
| | | |
| | | private Integer initial_ymomentum; |
| | | |
| | | private String raingage; |
| | | |
| | | private String infiltration; |
| | | |
| | | private Integer duration; |
| | | |
| | | private Boolean save_state; |
| | | |
| | | private List<String> save_variables; |
| | | |
| | | private Integer save_interval; |
| | | |
| | | private Integer save_frames; |
| | | |
| | | private Integer save_start; |
| | | |
| | | private Double dt; |
| | | |
| | | private Boolean variable_dt; |
| | | |
| | | private ResultVo result; |
| | | |
| | | public ConfigVo() { |
| | | terrain = new ArrayList<Object>(Arrays.asList("Data/Hillzone.tif", 1)); |
| | | landuse = new ArrayList<Object>(Arrays.asList("Data/landuse.tif", 1)); |
| | | station = new ArrayList<Object>(Arrays.asList("Data/station.tif", 1)); |
| | | kSt = 40; |
| | | raingage = "Data/beijing.dat"; |
| | | infiltration = "Data/landuse_to_infiltration.dat"; |
| | | duration = 3600 * 24; |
| | | save_state = true; |
| | | save_variables = new ArrayList<>(Arrays.asList("depth")); |
| | | save_interval = 60; |
| | | save_frames = 60; |
| | | save_start = 0; |
| | | dt = 0.1; |
| | | variable_dt = true; |
| | | this.terrain = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_f32.tif", 1)); |
| | | // 1-Cropland,2-Forest,3-Shrub,4-Grassland,5-Water,6-Snow/Ice,7-Barren,8-Impervious,9-Wetland |
| | | this.landuse = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_landuse_grassland.tif", 1)); |
| | | this.station = new ArrayList<Object>(Arrays.asList("case1/LiuLiMiaoZhen_5m_station.tif", 1)); |
| | | |
| | | this.kSt = 40; |
| | | this.initial_depth = 0; |
| | | this.initial_xmomentum = 0; |
| | | this.initial_ymomentum = 0; |
| | | this.infiltration = "case1/landuse_to_infiltration.dat"; |
| | | this.dt = 0.1; |
| | | this.variable_dt = true; |
| | | } |
| | | |
| | | public ConfigVo(int duration, int frames, String terrain, String landuse, String station, String raingage) { |
| | | public ConfigVo(String terrain, String landuse, String station, String raingage, String saveName, int duration, int frames) { |
| | | this(); |
| | | |
| | | this.terrain.set(0, terrain.replace("\\", "/")); // å°å½¢é«ç¨æ°æ® |
| | | //this.landuse.set(0, landuse.replace("\\", "/")); // åå°å©ç¨ç±»å |
| | | this.station.set(0, station.replace("\\", "/")); // é¨éç«ç´¢å¼ |
| | | this.raingage = raingage.replace("\\", "/"); |
| | | this.duration = duration; |
| | | this.save_frames = frames; |
| | | this.save_interval = this.duration / frames; |
| | | this.terrain.set(0, terrain); // å°å½¢é«ç¨æ°æ® |
| | | this.landuse.set(0, landuse); // åå°å©ç¨ç±»å |
| | | this.station.set(0, station); // é¨éç«ç´¢å¼ |
| | | this.raingage = raingage; |
| | | |
| | | this.result = new ResultVo(saveName, duration, frames); |
| | | } |
| | | |
| | | public List<Object> getTerrain() { |
| | |
| | | this.kSt = kSt; |
| | | } |
| | | |
| | | public Integer getInitial_depth() { |
| | | return initial_depth; |
| | | } |
| | | |
| | | public void setInitial_depth(Integer initial_depth) { |
| | | this.initial_depth = initial_depth; |
| | | } |
| | | |
| | | public Integer getInitial_xmomentum() { |
| | | return initial_xmomentum; |
| | | } |
| | | |
| | | public void setInitial_xmomentum(Integer initial_xmomentum) { |
| | | this.initial_xmomentum = initial_xmomentum; |
| | | } |
| | | |
| | | public Integer getInitial_ymomentum() { |
| | | return initial_ymomentum; |
| | | } |
| | | |
| | | public void setInitial_ymomentum(Integer initial_ymomentum) { |
| | | this.initial_ymomentum = initial_ymomentum; |
| | | } |
| | | |
| | | public String getRaingage() { |
| | | return raingage; |
| | | } |
| | |
| | | this.duration = duration; |
| | | } |
| | | |
| | | public Boolean getSave_state() { |
| | | return save_state; |
| | | } |
| | | |
| | | public void setSave_state(Boolean save_state) { |
| | | this.save_state = save_state; |
| | | } |
| | | |
| | | public List<String> getSave_variables() { |
| | | return save_variables; |
| | | } |
| | | |
| | | public void setSave_variables(List<String> save_variables) { |
| | | this.save_variables = save_variables; |
| | | } |
| | | |
| | | public Integer getSave_interval() { |
| | | return save_interval; |
| | | } |
| | | |
| | | public void setSave_interval(Integer save_interval) { |
| | | this.save_interval = save_interval; |
| | | } |
| | | |
| | | public Integer getSave_frames() { |
| | | return save_frames; |
| | | } |
| | | |
| | | public void setSave_frames(Integer save_frames) { |
| | | this.save_frames = save_frames; |
| | | } |
| | | |
| | | public Integer getSave_start() { |
| | | return save_start; |
| | | } |
| | | |
| | | public void setSave_start(Integer save_start) { |
| | | this.save_start = save_start; |
| | | } |
| | | |
| | | public Double getDt() { |
| | | return dt; |
| | | } |
| | |
| | | public void setVariable_dt(Boolean variable_dt) { |
| | | this.variable_dt = variable_dt; |
| | | } |
| | | |
| | | public ResultVo getResult() { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(ResultVo result) { |
| | | this.result = result; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.nsl.domain.vo; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class ResultVo { |
| | | private String save_name; |
| | | |
| | | private List<String> save_variables; |
| | | |
| | | private Integer save_frames; |
| | | |
| | | private Integer save_interval; |
| | | |
| | | private Integer save_start; |
| | | |
| | | private Integer save_filter; |
| | | |
| | | public ResultVo() { |
| | | this.save_variables = new ArrayList<>(Arrays.asList("depth", "xmomentum", "ymomentum")); |
| | | this.save_start = 0; |
| | | this.save_filter = 0; |
| | | } |
| | | |
| | | public ResultVo(String saveName, int duration, int frames) { |
| | | this(); |
| | | |
| | | this.save_name = saveName.replace("\\", "/"); |
| | | this.save_frames = frames; |
| | | // ç»ææ°æ®ä¸ç¸é»å¸§çæ¨¡ææ¶é´é´éï¼åä½ï¼ç§ï¼ï¼save_start + save_frames * save_interval <= duration |
| | | this.save_interval = duration / frames; |
| | | } |
| | | |
| | | public String getSave_name() { |
| | | return save_name; |
| | | } |
| | | |
| | | public void setSave_name(String save_name) { |
| | | this.save_name = save_name; |
| | | } |
| | | |
| | | public List<String> getSave_variables() { |
| | | return save_variables; |
| | | } |
| | | |
| | | public void setSave_variables(List<String> save_variables) { |
| | | this.save_variables = save_variables; |
| | | } |
| | | |
| | | public Integer getSave_frames() { |
| | | return save_frames; |
| | | } |
| | | |
| | | public void setSave_frames(Integer save_frames) { |
| | | this.save_frames = save_frames; |
| | | } |
| | | |
| | | public Integer getSave_interval() { |
| | | return save_interval; |
| | | } |
| | | |
| | | public void setSave_interval(Integer save_interval) { |
| | | this.save_interval = save_interval; |
| | | } |
| | | |
| | | public Integer getSave_start() { |
| | | return save_start; |
| | | } |
| | | |
| | | public void setSave_start(Integer save_start) { |
| | | this.save_start = save_start; |
| | | } |
| | | |
| | | public Integer getSave_filter() { |
| | | return save_filter; |
| | | } |
| | | |
| | | public void setSave_filter(Integer save_filter) { |
| | | this.save_filter = save_filter; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * åå§ååæ° |
| | | */ |
| | | private void initArgs(SimuData data) throws IOException { |
| | | public void initArgs(SimuData data) throws IOException { |
| | | String inPath = config.getInPath() + File.separator + data.getInPath(); |
| | | createDir(inPath); |
| | | createDir(inPath + File.separator + "depth"); |
| | |
| | | |
| | | // 临æ¶å¤å¶é«ç¨tifï¼ä»¥åéè¦èªè¡åå² |
| | | File uwBat = new File(config.getUwSolverBat()); |
| | | String sourceTif = uwBat.getParent() + File.separator + "data" + File.separator + "Hillzone.tif"; |
| | | String sourceTif = uwBat.getParent() + File.separator + "case1" + File.separator + "LiuLiMiaoZhen_5m_f32.tif"; |
| | | String targetTif = inPath + File.separator + config.getDemFile(); |
| | | Files.copy(Paths.get(sourceTif), Paths.get(targetTif), StandardCopyOption.REPLACE_EXISTING); |
| | | } |
| | |
| | | f.mkdirs(); |
| | | } |
| | | |
| | | private void createRainfallFile(Simu simu, SimuData data) throws Exception { |
| | | public void createRainfallFile(Simu simu, SimuData data) throws Exception { |
| | | List<Rainfall> rainfalls = data.getRainfalls(); |
| | | if (null == rainfalls || rainfalls.size() < 2) createRainfall(simu); |
| | | |
| | |
| | | /** |
| | | * è°ç¨UWSolver |
| | | */ |
| | | private String callUwSolver(SimuData data) throws Exception { |
| | | public String callUwSolver(SimuData data) throws Exception { |
| | | File uwBat = new File(config.getUwSolverBat()); |
| | | |
| | | int duration = 3600 * data.getDuration(); // ç§æ° |
| | |
| | | } |
| | | |
| | | String inPath = config.getInPath() + File.separator + data.getInPath(); |
| | | String terrainFile = (inPath + File.separator + config.getDemFile()).replace("\\", "/"); |
| | | String rainfallFile = (inPath + File.separator + "rainfall.dat").replace("\\", "/"); |
| | | ConfigVo vo = new ConfigVo(duration, config.getSaveFrames(), terrainFile, terrainFile, terrainFile, rainfallFile); |
| | | String terrainFile = (inPath + File.separator + config.getDemFile()); |
| | | String rainfallFile = (inPath + File.separator + "rainfall.dat"); |
| | | String saveName = inPath + File.separator + "result.zarr"; |
| | | ConfigVo vo = new ConfigVo(terrainFile, terrainFile, terrainFile, rainfallFile, saveName, duration, config.getSaveFrames()); |
| | | |
| | | String configFile = config.getInPath() + File.separator + data.getInPath() + File.separator + data.getInPath() + ".json"; |
| | | ComHelper.writeJson(configFile, JSON.toJSONString(vo)); |
| | | |
| | | String cmd = String.format("%s %s", config.getUwSolverBat(), configFile); |
| | | |
| | | return callBat(cmd); |
| | | return callBat2(cmd); |
| | | } |
| | | |
| | | /** |
| | |
| | | flowUnits: CMS |
| | | solverBat: D:\other\simu\uwsolver\run_solver.bat |
| | | sww2tifBat: D:\other\simu\uwsolver\sww2tif.bat |
| | | uwSolverBat: D:\other\simu\CudaUWSolver.Demo.NoVis.20250430\start.bat |
| | | #uwSolverBat: D:\other\simu\CudaUWSolver.Demo.NoVis.20250430\start.bat |
| | | uwSolverBat: D:\other\simu\CudaUWSolver-2.0\start.bat |
| | | #zarr2tifBat: D:\other\simu\zarr2tif1.0\start.bat |
| | | #zarr2tifBat: D:\other\simu\zarr2tif-2.0-mkl\start.bat |
| | | zarr2tifBat: D:\other\simu\zarr2tif-2.1\start.bat |
| | |
| | | rainfallTitle: Station Longitude Latitude Year Month Day Hour Minute Intensity |
| | | rainfallSite: beijing |
| | | epsg: 4548 |
| | | saveFrames: 10 |
| | | saveFrames: 12 |
| | | # åå°å©ç¨ï¼1-Cropland,2-Forest,3-Shrub,4-Grassland,5-Water,6-Snow/Ice,7-Barren,8-Impervious,9-Wetland |
| | | landuse: 2 |
| | | #sizes: 64,128,256,512,1024,2048,4096 |