月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-16 64b4e6fbbf2c3f89166cb39e3bfd1ede976181c6
栅格分析的结果以消息推送的形式返回-1
已修改3个文件
43 ■■■■■ 文件已修改
src/main/java/com/moon/server/controller/data/RasterAnalysisController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/entity/all/StaticData.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/RasterAnalysisService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/controller/data/RasterAnalysisController.java
@@ -3,7 +3,9 @@
import com.moon.server.annotation.SysLog;
import com.moon.server.controller.all.BaseController;
import com.moon.server.entity.all.ResponseMsg;
import com.moon.server.entity.all.StaticData;
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;
@@ -14,6 +16,8 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
@@ -112,4 +116,34 @@
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "使用WKT查询分析,结果以消息推送")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wkt", value = "WKT字符串", dataType = "String", example = "POLYGON ((56.61 33.94,115.04 33.56,114.09 -7.17,52.22 -6.22,56.61 33.94))"),
            @ApiImplicitParam(name = "size", value = "像素值(点)或节点数(线)", dataType = "Integer", example = "16")
    })
    @GetMapping(value = "/selectByWktForPost")
    public void selectByWktForPost(String wkt, Integer size, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (StringHelper.isEmpty(wkt)) {
                WebHelper.writeStr2Page(res, "WKT字符串不能为空");
                return;
            }
            Geometry geo = Geometry.CreateFromWkt(wkt);
            if (null == geo || geo.GetGeometryType() != ogr.wkbPolygon) {
                WebHelper.writeStr2Page(res, "WKT字符串不正确");
                return;
            }
            if (null == size || size < 0 || size > StaticData.I1024) {
                WebHelper.writeStr2Page(res, "像素值(点)或节点数(线)值不正确");
                return;
            }
            String token = WebHelper.getToken(req);
            rasterService.analysisForPost(geo, size, token);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
}
src/main/java/com/moon/server/entity/all/StaticData.java
@@ -82,6 +82,8 @@
    public static final int I1000 = 1000;
    public static final int I1024 = 1024;
    public static final int I2050 = 2050;
    public static final int I4326 = 4326;
src/main/java/com/moon/server/service/data/RasterAnalysisService.java
@@ -51,6 +51,13 @@
    }
    /**
     * 使用WKT查询分析,结果以消息推送
     */
    public void analysisForPost(Geometry geo, Integer size, String token) {
        //
    }
    /**
     * 分析方法
     */
    public List<AnalysisResultEntity> analysis(Geometry geo, Integer size) {