| | |
| | | return; |
| | | } |
| | | Geometry geo = Geometry.CreateFromWkt(wkt); |
| | | if (null == geo || geo.GetGeometryType() != ogr.wkbPolygon) { |
| | | if (null == geo) { |
| | | WebHelper.writeStr2Page(res, "WKT字符串不正确"); |
| | | return; |
| | | } |
| | | int wktType = geo.GetGeometryType(); |
| | | if (wktType != ogr.wkbPoint && wktType != ogr.wkbLineString && wktType != ogr.wkbPolygon) { |
| | | WebHelper.writeStr2Page(res, "WKT字符串只支持点、线串和面类型"); |
| | | return; |
| | | } |
| | | if (null == size || size < 0 || size > StaticData.I1024) { |
| | | WebHelper.writeStr2Page(res, "像素值(点)或节点数(线)值不正确"); |
| | | return; |
| | |
| | | |
| | | int count = markService.insert(entity); |
| | | |
| | | return success(count); |
| | | return success(count, entity.getId()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | |
| | | } |
| | | // 9.获取资源实体,status:0-禁用,1-启用原始地址,2-启用代理地址 |
| | | ResEntity entity = getResEntity(ue, resId); |
| | | if (null == entity || StaticData.I2 != entity.getStatus() || StringHelper.isNull(entity.getProxy()) || StringHelper.isNull(entity.getUrl())) { |
| | | if (null == entity || StaticData.I1 > entity.getStatus() || StringHelper.isNull(entity.getProxy()) || StringHelper.isNull(entity.getUrl())) { |
| | | WebHelper.writeStr2Page(res, ILLEGAL_RESOURCE); |
| | | return; |
| | | } |
| | |
| | | String layersKey = isLower ? StaticData.LAYERS : StaticData.LAYERS.toUpperCase(); |
| | | String layers = req.getParameter(layersKey); |
| | | String request = req.getParameter(isLower ? StaticData.REQUEST : StaticData.REQUEST.toUpperCase()); |
| | | if (!StaticData.GET_CAPABILITIES.equals(request) && null != layers) { |
| | | if (!StaticData.GET_CAPABILITIES.equals(request)) { |
| | | int start = str.indexOf(layersKey); |
| | | int end = str.indexOf("&", start); |
| | | layers = filterGeoLayers(ue, layers); |
| | |
| | | */ |
| | | private String filterGeoLayers(UserEntity ue, String layers) { |
| | | List<String> tabs = StaticData.ADMIN.equals(ue.getUid()) ? permsService.selectAllTabs() : permsService.selectTabs(ue.getUid()); |
| | | if (null == tabs || tabs.isEmpty()) { |
| | | if (null == tabs || tabs.isEmpty() || StringHelper.isEmpty(layers)) { |
| | | return ""; |
| | | } |
| | | |
| | |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.moon.server.entity.show.MarkEntity"> |
| | | <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
| | | select currval('lf.sys_mark_id_seq'::regclass) as id |
| | | </selectKey> |
| | | |
| | | insert into lf.sys_mark |
| | | (name,wkt,create_user,create_time) |
| | | values |