|
@@ -101,72 +101,6 @@ public class RasterController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-// @ApiOperation("栅格数据普通坐标转换")
|
|
|
-// @GetMapping("command/transform/gdalwarp/{fileId}/")
|
|
|
-// private R cmdTansformGdalwarp(@PathVariable("fileId") Long fileId) {
|
|
|
-// log.info("run cmdTansformGdalwarp: {}", fileId);
|
|
|
-// FileEntity entity = fileServer.findById(fileId);
|
|
|
-//
|
|
|
-// String fileName = StringUtils.substringBefore(entity.getFileName(), ".");
|
|
|
-//
|
|
|
-// String cmd = Command.RASTER_TRANSFORM_GDALWARP;
|
|
|
-// cmd = cmd.replace("@fileName",fileName);
|
|
|
-// log.info("cmd: {}", cmd);
|
|
|
-//
|
|
|
-// Integer integer = cmdServer.exeCmdInt(cmd);
|
|
|
-// if (integer != 0) {
|
|
|
-// log.info("error command transform");
|
|
|
-// return new R(50005, MsgCode.E50005);
|
|
|
-// }
|
|
|
-//
|
|
|
-// FileEntity fileEntity = new FileEntity();
|
|
|
-// fileEntity.setFileName(entity.getFileName());
|
|
|
-// // /root/gis/cesium/input/transform/@fileName.tif
|
|
|
-// fileEntity.setFileUrl(INPUT_FILE_PATH + "transform" + File.separator + entity.getFileName());
|
|
|
-// fileEntity.setCreateTime(new Date());
|
|
|
-// fileEntity.setUpdateTime(new Date());
|
|
|
-// fileEntity.setType(TypeCode.FILE_TYPE_RASTER_TIF);
|
|
|
-// fileEntity = fileServer.save(fileEntity);
|
|
|
-//
|
|
|
-// return new R(200, fileEntity) ;
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-// @ApiOperation("栅格数据严格坐标转换")
|
|
|
-// @GetMapping("command/transform/strict/gdalwarp/{fileId}/")
|
|
|
-// private R cmdTansformGdalwarpStrict(@PathVariable("fileId") Long fileId) {
|
|
|
-// log.info("run cmdTansformGdalwarpStrict: {}", fileId);
|
|
|
-// FileEntity entity = fileServer.findById(fileId);
|
|
|
-//
|
|
|
-// String fileName = StringUtils.substringBefore(entity.getFileName(), ".");
|
|
|
-//
|
|
|
-// String step_1 = Command.RASTER_TRANSFORM_GDALWARP_STRICT_1;
|
|
|
-// String step_2 = Command.RASTER_TRANSFORM_GDALWARP_STRICT_2;
|
|
|
-// step_1 = step_1.replace("@fileName",fileName);
|
|
|
-// step_2 = step_2.replace("@fileName",fileName);
|
|
|
-// log.info("cmd1: {}", step_1);
|
|
|
-// log.info("cmd2: {}", step_2);
|
|
|
-//
|
|
|
-// Integer integer = cmdServer.exeCmd(step_1, step_2);
|
|
|
-//
|
|
|
-// if (integer != 0) {
|
|
|
-// log.info("error command transform");
|
|
|
-// return new R(50005, MsgCode.E50005);
|
|
|
-// }
|
|
|
-//
|
|
|
-// FileEntity fileEntity = new FileEntity();
|
|
|
-// fileEntity.setFileName(entity.getFileName());
|
|
|
-// // /root/gis/cesium/input/transform_strict/@fileName.tif
|
|
|
-// fileEntity.setFileUrl(INPUT_FILE_PATH + "transform_strict" + File.separator + entity.getFileName());
|
|
|
-// fileEntity.setCreateTime(new Date());
|
|
|
-// fileEntity.setUpdateTime(new Date());
|
|
|
-// fileEntity.setType(TypeCode.FILE_TYPE_RASTER_TIF);
|
|
|
-// fileEntity = fileServer.save(fileEntity);
|
|
|
-//
|
|
|
-// return new R(200, fileEntity) ;
|
|
|
-// }
|
|
|
-
|
|
|
@ApiOperation("栅格数据切片命令")
|
|
|
@GetMapping("command/osgeo/{fileId}/")
|
|
|
private R cmdOsgeo(@PathVariable("fileId") Long fileId) {
|
|
@@ -181,11 +115,6 @@ public class RasterController {
|
|
|
cmd = cmd.replace("@fileName",fileName);
|
|
|
log.info("cmd: {}", cmd);
|
|
|
|
|
|
-// Integer integer = cmdServer.exeCmdRasterSlice(cmd);
|
|
|
-// if (integer != 0) {
|
|
|
-// log.info("error command exeCmdRasterSlice");
|
|
|
-// return new R(50005, MsgCode.E50005);
|
|
|
-// }
|
|
|
|
|
|
FileEntity fileEntity = new FileEntity();
|
|
|
fileEntity.setFileName(fileName);
|
|
@@ -276,25 +205,6 @@ public class RasterController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- // String a = "112222.zip";
|
|
|
-// String b = "11/2222/aa";
|
|
|
-// String c = "11/2222/aa.zip";
|
|
|
-// String e = "/root/gis/cesium/input/test/clip.shp";
|
|
|
-// System.out.println(StringUtils.stripStart(a, "."));
|
|
|
-// System.out.println("After: " + StringUtils.substringAfter(a, "."));
|
|
|
-// System.out.println("before: " + StringUtils.substringBefore(a, "."));
|
|
|
-// System.out.println("c: " + StringUtils.substringBefore(c, "/"));
|
|
|
-// System.out.println("c: " + StringUtils.substringBeforeLast(c, "/"));
|
|
|
-// System.out.println(StringUtils.substringBefore(b, "/"));
|
|
|
-// System.out.println(StringUtils.substringBeforeLast(b, "/"));
|
|
|
-// System.out.println(StringUtils.substring(b, b.lastIndexOf("/") + 1, b.length()));
|
|
|
-// System.out.println("e: " + StringUtils.substringBeforeLast(e, "/"));
|
|
|
-// System.out.println("e1: " + StringUtils.substring(e, e.indexOf("input/") + 6, e.lastIndexOf("/")));
|
|
|
-// System.out.println("===========================================");
|
|
|
-// System.out.println();
|
|
|
-//
|
|
|
-// System.out.println("a: " + StringUtils.substringAfterLast(a, "."));
|
|
|
-
|
|
|
public static void main(String[] args) {
|
|
|
String a = "0...10...20...30...40...50...60...70...80...90...100.....10..11";
|
|
|
String b = "...10";
|