| | |
| | | import com.se.simu.domain.dto.GeLayer; |
| | | import com.se.simu.domain.po.DataPo; |
| | | import com.se.simu.domain.po.SimuPo; |
| | | import com.se.simu.domain.vo.CreateFilesSimuVo; |
| | | import com.se.simu.domain.vo.CreateSimuVo; |
| | | import com.se.simu.domain.vo.R; |
| | | import com.se.simu.domain.vo.SimuVo; |
| | | import com.se.simu.domain.vo.*; |
| | | import com.se.simu.service.*; |
| | | import com.se.simu.utils.CsvToSQLiteUtils; |
| | | import com.se.simu.utils.ShpToolUtils; |
| | | import com.se.simu.utils.ZarrUtils; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | String stationRainFile = vo.getStationRainFile(); |
| | | log.info("站点雨量CSV文件地址:{}", floodFile); |
| | | JSONArray array = new JSONArray(); |
| | | // 创建表名 时间戳 |
| | | String tableName = "station_rain_" + System.currentTimeMillis(); |
| | | try { |
| | | // 判断地址不为空 |
| | | if (StringUtils.isEmpty(stationRainFile)) { |
| | | return fail("站点雨量CSV文件地址不能为空", false); |
| | | } |
| | | // 创建表名 时间戳 |
| | | String tableName = "station_rain_" + System.currentTimeMillis(); |
| | | // 1 读取CSV 文件 |
| | | array = CsvToSQLiteUtils.readCsvSaveLocal(stationRainFile, tableName); |
| | | // 获取仿真时间 duration |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "tarr文件组装") |
| | | @GetMapping(value = "/testZarr", produces = "application/json; charset=UTF-8") |
| | | public R<Boolean> testZarr(@RequestParam("name") String tableName) throws IOException { |
| | | List<String> list = CsvToSQLiteUtils.getNameList(tableName); |
| | | String basePath="D:\\城市内涝\\sem\\雨量站点数据\\降雨量zarr\\"; |
| | | for (String src : list |
| | | ) { |
| | | List<StationRainVo> stationRainVos = CsvToSQLiteUtils.getList(tableName, src); |
| | | ZarrUtils.saveZarrRainfall(basePath+src,stationRainVos); |
| | | ZarrUtils.saveZarrTime(basePath+src,stationRainVos); |
| | | System.out.println(src+"的zarr数据生成====================="); |
| | | } |
| | | return success(true); |
| | | } |
| | | |
| | | } |