| | |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.RasterAnalysisService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return fail("WKT字符串不正确"); |
| | | } |
| | | if (null == pixel || !PIXELS.contains(pixel)) { |
| | | return fail("像点值只能为:" + StringHelper.join(PIXELS, ", ")); |
| | | return fail("像素值只能为:" + StringHelper.join(PIXELS, ", ")); |
| | | } |
| | | |
| | | List<?> rs = rasterService.analysis(geo, pixel); |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询线分析") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "LINESTRING(165.680851 31.333443,166.383982 31.283475,166.016355 30.908709)") |
| | | @ApiImplicitParam(name = "wkt", value = "线WKT", dataType = "String", example = "LINESTRING(165.680851 31.333443,166.383982 31.283475,166.016355 30.908709)"), |
| | | @ApiImplicitParam(name = "pixel", value = "像素值", dataType = "Integer", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPolyline") |
| | | public ResponseMsg<Object> selectByPolyline(String wkt) { |
| | | public ResponseMsg<Object> selectByPolyline(String wkt, Integer pixel) { |
| | | try { |
| | | if (StringHelper.isEmpty(wkt)) { |
| | | return fail("WKT字符串不能为空"); |
| | |
| | | if (null == geo || geo.GetGeometryType() != ogr.wkbLineString) { |
| | | return fail("WKT字符串不正确"); |
| | | } |
| | | if (null == pixel || !PIXELS.contains(pixel)) { |
| | | return fail("像素值只能为:" + StringHelper.join(PIXELS, ", ")); |
| | | } |
| | | |
| | | List<?> rs = rasterService.analysis(geo, 0); |
| | | List<?> rs = rasterService.analysis(geo, pixel); |
| | | |
| | | return success(rs.size(), rs); |
| | | } catch (Exception ex) { |