| | |
| | | Double minY = jsonObject.getDouble("minX"); |
| | | Double maxY = jsonObject.getDouble("maxX"); |
| | | // 3 判断范围值是否为空 |
| | | // vo.setMinx(jsonObject.getDouble("minX")); |
| | | // vo.setMaxx(jsonObject.getDouble("maxX")); |
| | | // vo.setMiny(jsonObject.getDouble("minY")); |
| | | // vo.setMaxy(jsonObject.getDouble("maxY")); |
| | | vo.setMinx(jsonObject.getDouble("minY")); |
| | | vo.setMaxx(jsonObject.getDouble("maxY")); |
| | | vo.setMiny(jsonObject.getDouble("minX")); |
| | |
| | | return fail("防汛范围不能为空", false); |
| | | } |
| | | } |
| | | List<GridDto> dtos = new ArrayList<>(); |
| | | dtos.add(new GridDto(vo.getMinx(), vo.getMiny())); |
| | | dtos.add(new GridDto(vo.getMinx(), vo.getMaxy())); |
| | | dtos.add(new GridDto(vo.getMaxx(), vo.getMaxy())); |
| | | dtos.add(new GridDto(vo.getMaxx(), vo.getMiny())); |
| | | createSem(tableName, dtos); |
| | | // 开始模拟计算 |
| | | boolean flag = simuFilesService.createByfiles(vo); |
| | | return success(flag, flag ? "成功" : "失败"); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | public R<Boolean> createSem(String tableName, List<GridDto> dtos) throws Exception { |
| | | //降雨文件生成 |
| | | saveZarr(tableName); |
| | | //管点生成 |
| | | pointTosem(dtos); |
| | | //管线生成 |
| | | lineToSem(dtos); |
| | | //地形生成 |
| | | terrainToSem(dtos); |
| | | //范围生成 |
| | | gridToCityJson(dtos); |
| | | //河流生成 |
| | | riverToSem(); |
| | | //土地利用生成 |
| | | landuseToSem(); |
| | | return success(true); |
| | | } |
| | | |
| | | @ApiOperation(value = "tarr文件组装") |
| | |
| | | SemUtils.cityJsonToSem(pointPath, filePatn + "node.sem"); |
| | | return success(filePatn + "node.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "管点转cityjson") |
| | | @GetMapping(value = "/pointToCityJson", produces = "application/json; charset=UTF-8") |
| | | public R<String> pointToCityJson(@RequestParam("shpPath") String shpPath) throws Exception { |
| | |
| | | SemUtils.cityJsonToSem(pointPath, filePatn + "link.sem"); |
| | | return success(filePatn + "link.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "地形转sem") |
| | | @PostMapping(value = "/terrainToSem", produces = "application/json; charset=UTF-8") |
| | | public R<String> terrainToSem(@RequestBody List<GridDto> dtos) throws Exception { |