| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询线分析") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "LINESTRING(115.94927385452 32.3754479115071,121.989371092554 32.2766788010181,121.850621222894 29.6874200067864)") |
| | | @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "LINESTRING(165.680851 31.333443,166.383982 31.283475,166.016355 30.908709)") |
| | | }) |
| | | @GetMapping(value = "/selectByPolyline") |
| | | public ResponseMsg<Object> selectByPolyline(String wkt) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询面分析") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "wkt", value = "面WKT", dataType = "String", example = "POLYGON ((115.94927385452 32.3754479115071,121.989371092554 32.2766788010181,121.850621222894 29.6874200067864,115.9727267226 29.7835368627922,115.94927385452 32.3754479115071))") |
| | | @ApiImplicitParam(name = "wkt", value = "面WKT", dataType = "String", example = "POLYGON ((165.680851 31.333443,166.383982 31.283475,166.016355 30.908709,165.680851 31.333443))") |
| | | }) |
| | | @GetMapping(value = "/selectByPolygon") |
| | | public ResponseMsg<Object> selectByPolygon(String wkt) { |
| | |
| | | // double rotationX = transform[2]; double rotationY = transform[4] |
| | | double minX = transform[0], pixelWidth = transform[1], maxY = transform[3], pixelHeight = transform[5]; |
| | | |
| | | double[] bounds = new double[6]; |
| | | double[] bounds = new double[4]; |
| | | polyline.GetEnvelope(bounds); |
| | | double startX = bounds[0], endX = bounds[1], startY = bounds[2], endY = bounds[3]; |
| | | |
| | |
| | | double[] transform = ds.GetGeoTransform(); |
| | | // double rotationX = transform[2]; double rotationY = transform[4] |
| | | double minX = transform[0], pixelWidth = transform[1], maxY = transform[3], pixelHeight = transform[5]; |
| | | double[] env = new double[6]; |
| | | double[] env = new double[4]; |
| | | polygon.GetEnvelope(env); |
| | | |
| | | int xMinPixel = (int) Math.floor((env[0] - minX) / pixelWidth); |
| | | int yMinPixel = (int) Math.floor((maxY - env[3]) / Math.abs(pixelHeight)); |
| | | int yMinPixel = (int) Math.floor((maxY - env[2]) / Math.abs(pixelHeight)); |
| | | int xMaxPixel = (int) Math.floor((env[1] - minX) / pixelWidth); |
| | | int yMaxPixel = (int) Math.floor((maxY - env[2]) / Math.abs(pixelHeight)); |
| | | int yMaxPixel = (int) Math.floor((maxY - env[3]) / Math.abs(pixelHeight)); |
| | | |
| | | int bandCount = ds.getRasterCount(); |
| | | int geoWidth = Math.abs(xMaxPixel - xMinPixel); |