| | |
| | | -- delete from lf.sys_layer where id=427; |
| | | |
| | | -- 28.178 |
| | | select * from bd.dlg_25w_boul where ST_Intersects(geom, ST_Buffer(ST_GeomFromText('POINT (101.9281 36.58675)', 4490), 10, 'endcap=round join=round')) limit 20; |
| | | |
| | | select * from bd.dlg_25w_boul where ST_DWithin(geom, ST_GeomFromText('POINT (101.9281 36.58675)', 4490), 10) = true limit 20; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | ---------------------------------------------------------------------------------------------- 00.SQL查询 |
| | | -- 缓冲区查询 |
| | | select * from bd.dlg_25w_boul where ST_Intersects(geom, ST_Buffer(ST_GeomFromText('POINT (101.9281 36.58675)', 4490), 10, 'endcap=round join=round')) limit 20; |
| | | select * from bd.dlg_25w_boul where ST_DWithin(geom, ST_GeomFromText('POINT (101.9281 36.58675)', 4490), 10) = true limit 20; |
| | | |
| | | select id,cn_name,en_name,url,serve_type,data_type from lf.sys_layer where url is not null and |
| | | serve_type='WMS' and data_type in ('工程项目','工程项目-地灾类','工程项目-测量类','工程项目-洞库类','工程项目-勘察类') order by id; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.ctrl.KeyValueEntity; |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "映射名称", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "wkt", value = "WKT(著名文本)", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "buffer", value = "缓冲区大小", dataType = "Double", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "limit", value = "限制条数", dataType = "Integer", paramType = "query", example = "20") |
| | | }) |
| | | @GetMapping(value = "/selectByBuffer") |
| | | public ResponseMsg<List<Object>> selectByBuffer(String name, String wkt, Integer limit) { |
| | | public ResponseMsg<List<Object>> selectByBuffer(String name, String wkt, Double buffer, Integer limit) { |
| | | try { |
| | | if (StringHelper.isEmpty(wkt)) { |
| | | return fail("WKT不能为空", null); |
| | | } |
| | | if (null == limit || limit < 1 || limit > StaticData.ONE_HUNDRED) { |
| | | limit = 20; |
| | | } |
| | | if (null == buffer || buffer < 0 || buffer > StaticData.ONE_HUNDRED_THOUSAND) { |
| | | buffer = 10.0; |
| | | } |
| | | |
| | | GeomBaseMapper baseMapper = ClassHelper.getGeoBaseMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | baseQueryService.addBufferWrapper(baseMapper, wrapper, wkt, buffer); |
| | | |
| | | return success(0, null); |
| | | } catch (Exception ex) { |
| | |
| | | public final static int ONE_HUNDRED = 100; |
| | | |
| | | /** |
| | | * 数值:100,000 |
| | | */ |
| | | public final static int ONE_HUNDRED_THOUSAND = 100000; |
| | | |
| | | /** |
| | | * 数值:200 |
| | | */ |
| | | public final static int TWO_HUNDRED = 200; |
| | |
| | | return tabName; |
| | | } |
| | | |
| | | /** |
| | | * 添加缓冲区过滤条件 |
| | | * |
| | | * @param baseMapper 父Mapper |
| | | * @param wrapper QueryWrapper |
| | | * @param wkt WKT(著名文本) |
| | | */ |
| | | public void addBufferWrapper(GeomBaseMapper baseMapper, QueryWrapper wrapper, String wkt, double buffer) { |
| | | Integer srid = getSrid(baseMapper); |
| | | if (null == srid) { |
| | | srid = 4490; |
| | | } |
| | | |
| | | wrapper.apply(String.format("ST_Intersects(geom, ST_Buffer(ST_GeomFromText('%s', %d), %f, 'endcap=round join=round'))", wkt, srid, buffer)); |
| | | } |
| | | |
| | | @Override |
| | | public List<IdNameEntity> selectUserFuzzy(String name) { |
| | | name = StringHelper.getLikeStr(name); |