geoserver发布瓦片_【server@geoserver】WFS服务空间关系查询

011c3111e75f6effd4e55522279bf40a.png

WFS,即Web要素服务,支持对地理要素的插入,更新,删除,检索和发现服务。不同于WMS(Web地图服务)的是,该服务专注于要素的地理信息,而忽略其渲染信息,简化了返回信息。

       一个图层的WFS服务查看方法是在Layer Preview页面,选择WFS下的GeoJSON(以JSON数据形式展现要素信息,方便解析),查看该图层的要素信息。

       c0f9dc70fb105c052a1b105d74c86cb6.png

      解析的参数为:

http://localhost:28080/geoserver/topp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:states&maxFeatures=50&outputFormat=application%2Fjson

  其中各个参数意义可以参照此篇文章:http://www.cnblogs.com/naaoveGIS/p/5508882.html

       这个请求,查询的是此图层的全量数据(返回要素数量受maxFeatures参数限制),我们可以添加过滤条件,得到我们想要的数据(非常强大的功能,可以实现非常多的地理查询操作),下面我就以几个空间查询的例子来举例说明一下。

       1、划分区域,查询区域内的点

http://localhost:28080/geoserver/sf/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sf:bugsites&maxFeatures=50&outputFormat=application%2Fjson&filter=        the_geom                      604264,4919992 604340,4913350 611059,4915487 604264,4919992                       

  空间关系          a6c49e560f9e01b41e07d7c8b7332902.png

  参数说明

        A:此次采取的几何方式是Intersects,即采用面与点相交,得到这个面里面的点数据

        B:多边形经纬度为一个数组,第一个点经纬度要与最后一个点一致,保证多边形的闭合

       C:过滤条件里有一个PropertyName属性,为必须字段,根据图层的属性来查看,具体查看方式为点击图层,然后点及要查询的图层名称,要素类型的第一个属性,即为该字段的值,过程如下图所示

51d5e2a89b836a1e1db6ff9fcfe673c4.png

c513a985bdfb48e68fd2f11f68873be8.png

f07dba1497a19a4a4e777fc12ebfdb4d.png

 2、  传入点坐标,查询该点所在的区域信息

http://localhost:28080/geoserver/topp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:tasmania_water_bodies&maxFeatures=50&outputFormat=application%2Fjson&filter=      the_geom            146.200,-42.700           

835d7cfa5f7680e3013d82602ce3b2cc.png

查询说明:

      A:此次采取的几何方式是Intersects,即采用点与面相交,得到包含这个点的面数据

      查询结果:

     bcb20822555fd2b48924b119cc06a9e2.png

      3、  查看被线穿过的区域

http://localhost:28080/geoserver/topp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:tasmania_water_bodies&maxFeatures=50&outputFormat=application%2Fjson&filter=                        the_geom                    146.62903,-41.85171 147.27448,-42.18130                        

   空间关系

         f01e9c808335709ebeeca27a1c954887.png        

         查询结果

         e25d912b63ff4d4cfae6ca7d89fdaf74.png   

下面是所有的空间关系介绍

Name

Arguments

Description

contains

a:Geometry, b:Geometry

Returns true if the geometry a contains b

crosses

a:Geometry, b:Geometry

Returns true if a crosses b

disjoint

a:Geometry, b:Geometry

Returns true if the two geometries are disjoint, false otherwise

equalsExact

a:Geometry, b:Geometry

Returns true if the two geometries are exactly equal, same coordinates in the same order

equalsExactTolerance

a:Geometry, b:Geometry, tol:Double

Returns true if the two geometries are exactly equal, same coordinates in the same order, allowing for a tol distance in the corresponding points

intersects

a:Geometry, b:Geometry

Returns true if a intersects b

isWithinDistance

a: Geometry, b:Geometry, distance: Double

Returns true if the distance between a and b is less than distance (measured as an euclidean distance)

overlaps

a: Geometry, b:Geometry

Returns true a overlaps with b

relate

a: Geometry, b:Geometry

Returns the DE-9IM intersection matrix for a and b

relatePattern

a: Geometry, b:Geometry, pattern:String

Returns true if the DE-9IM intersection matrix for aand b matches the specified pattern

touches

a: Geometry, b: Geometry

Returns true if a touches b according to the SQL simple feature specification rules

within

a: Geometry, b:Geometry

Returns true is fully contained inside b

【server@geoserver】geoserver服务部署和mysql 数据库图层服务发布

【server@supermap】SuperMap iserver 部署和服务发布

【server@geoserver】geoserver 栅格图发布成切片服务

【server@arcgis】ArcGIS server 重新创建Site

【server@geoserver】GeoServer 常用插件

【server@geoserver】GeoServer 矢量切片服务发布

【server@geoserver】WFS只读(readonly)解决办法

【server@geoserver】CQL and ECQL cql_filter例子

Leaflet入门系列


leaflet 入门系列 hello world

Leaflet入门系列 图层管理控件

Leaflet入门系列 比例尺控件Scale

Leaflet入门系列 Zoom控件

Leaflet入门系列 属性控件

Leaflet入门系列 图标(marker) 样式和事件处理

LeafLet入门系列 图标(marker)属性配置

Leaflet入门系列 popup

LeafLet入门系列 常用插件

LeafLet入门系统 加载wkt文件

LeafLet入门系列 GeoJSON图层

LeafLet入门系列 加载矢量切片

LeafLet入门系列 借助 turfjs 绘制点线面缓冲区

LeafLet入门系列 leaflet 常用插件

LeafLet入门系列 调用百度瓦片地图服务

END

 

请:右下点在看871e05462e292bb5a3dc4810c27d246e.gif,右上点【···】分享

e8331b0857e187c97715123f42dcdca9.png

关注我

发现更多精彩

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值