| | |
| | | @Value("${config.outPath}") |
| | | private String outPath; |
| | | |
| | | @Value("${config.inPath}") |
| | | private String inPath; |
| | | |
| | | |
| | | @Resource |
| | | ResultService resultService; |
| | |
| | | FileWriter fileWriter = new FileWriter(path + tableName + "\\éé¨é.json"); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | SemUtils.cityJsonToSem(path + tableName + "\\éé¨é.json", path + tableName + "\\station_rain.sem"); |
| | | return success(path + tableName + "\\station_rain.sem"); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(path + tableName + "\\éé¨é.json", filePatn + "raingage.sem"); |
| | | return success(filePatn + "raingage.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "管ç¹è½¬cityjson") |
| | |
| | | FileWriter fileWriter = new FileWriter(pointPath); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | SemUtils.cityJsonToSem(pointPath, path + times + "\\point.sem"); |
| | | return success(path + times + "\\point.sem"); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(pointPath, filePatn+ "node.sem"); |
| | | return success(filePatn+ "node.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "管线转cityjson") |
| | |
| | | FileWriter fileWriter = new FileWriter(pointPath); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | SemUtils.cityJsonToSem(pointPath, path + times + "\\line.sem"); |
| | | return success(path + times + "\\line.sem"); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(pointPath, filePatn+ "link.sem"); |
| | | return success(filePatn + "link.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å°å½¢è½¬cityjson") |
| | |
| | | FileWriter fileWriter = new FileWriter(path + "terrain.json"); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | SemUtils.cityJsonToSem(path + "terrain.json", path + "terrain.sem"); |
| | | return success(path + "terrain.sem"); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(path + "terrain.json", filePatn + "terrain.sem"); |
| | | return success(filePatn + "terrain.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "grid转cityjson") |
| | |
| | | FileWriter fileWriter = new FileWriter(path + "grid.json"); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | SemUtils.cityJsonToSem(path + "grid.json", path + "grid.sem"); |
| | | return success(path + "grid.sem"); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(path + "grid.json", filePatn + "grid.sem"); |
| | | return success(filePatn + "grid.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "river转sem") |
| | | @GetMapping(value = "/riverToSem", produces = "application/json; charset=UTF-8") |
| | | public R<String> riverToSem() throws Exception { |
| | | long times = System.currentTimeMillis(); |
| | | String path = outPath + "\\river\\" + times + "\\"; |
| | | File dirFile = new File(path); |
| | | if (!dirFile.exists()) { |
| | | dirFile.mkdirs(); |
| | | } |
| | | JSONObject jsonObject = getModule("river.json"); |
| | | FileWriter fileWriter = new FileWriter(path + "river.json"); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(path + "river.json", filePatn + "river.sem"); |
| | | return success(filePatn + "river.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "landuse转sem") |
| | | @GetMapping(value = "/landuseToSem", produces = "application/json; charset=UTF-8") |
| | | public R<String> landuseToSem() throws Exception { |
| | | long times = System.currentTimeMillis(); |
| | | String path = outPath + "\\landuse\\" + times + "\\"; |
| | | File dirFile = new File(path); |
| | | if (!dirFile.exists()) { |
| | | dirFile.mkdirs(); |
| | | } |
| | | JSONObject jsonObject = getModule("landuse.json"); |
| | | FileWriter fileWriter = new FileWriter(path + "landuse.json"); |
| | | fileWriter.write(jsonObject.toJSONString()); |
| | | fileWriter.close(); |
| | | String filePatn = inPath + "\\tongzhou\\"; |
| | | File file = new File(filePatn); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | SemUtils.cityJsonToSem(path + "landuse.json", filePatn + "landuse.sem"); |
| | | return success(filePatn + "landuse.sem"); |
| | | } |
| | | |
| | | public JSONObject getModule(String moduleName) { |