15158846557 在线咨询 在线咨询
15158846557 在线咨询
所在位置: 首页 > 营销资讯 > 网站运营 > WFS1.0.0空间查询(OGC XML的老写法)

WFS1.0.0空间查询(OGC XML的老写法)

时间:2023-05-10 04:27:02 | 来源:网站运营

时间:2023-05-10 04:27:02 来源:网站运营

WFS1.0.0空间查询(OGC XML的老写法):https://www.osgeo.cn/geoserver-user-manual/services/wfs/vendor.html#cql-filters
1、现在都按ECQL 的写法,会单独写一篇,不在此赘述。
2、按OGC XML过滤器的写法:(比较难写也不易读)
点的空间查询:
http://localhost:8088/geoserver/geomonitor/ows?service=WFS&version=1.0.0&request=GetFeature&typename=geomonitor:community_population&outputFormat=application/json&srsname=EPSG:3857&filter=<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><Intersects><PropertyName>geom</PropertyName><gml:Point><gml:coordinates>'+coor[0]+','+coor[1]+'</gml:coordinates></gml:Point></Intersects></Filter>

typename:图层服务名称;
outputFormat:输出方式,一般都是application/json
srsname:以哪个坐标系输出结果;
filter:
<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<Intersects> ///相交
<PropertyName>geom</PropertyName> /// 如果是postgis里的数据发的服务,这个字段就是geom,如果是shp数据发的服务,这个字段是the_geom,不知道原因,不知道是否可以修改字段名。
<gml:Point><gml:coordinates>'+coor[0]+','+coor[1]+'</gml:coordinates></gml:Point>
</Intersects>
</Filter>
线:
<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<Within>
<PropertyName>GEOM</PropertyName>
<gml:LineString>
<gml:coordinates>113.763,34.435 113.763,34.5 113.844,34.5 113.844,34.435</gml:coordinates>
</gml:LineString>
</Within>
</Filter>

面:

<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<Intersects><PropertyName>GEOM</PropertyName><gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
  <gml:coordinates>113.763,34.435 113.763,34.5 113.763,34.435</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon></Intersects></Filter>



空间操作符——拓扑操作符
这些运算符使用标准的OGC Simple Features谓词测试拓扑空间关系:
· <Intersects>- 测试两个几何是否相交
· <Disjoint>- 测试两个几何是否不相交
· <Contains>- 测试几何是否包含另一个几何
· <Within>- 测试几何是否在另一个之内
· <Touches>- 测试两个几何体是否接触
· <Crosses>- 测试两个几何图形是否交叉
· <Overlaps>- 测试两个几何图形是否重叠
· <Equals>- 测试两个几何是否在拓扑上相等


作者:什么时候能猫狗双全
链接:https://www.jianshu.com/p/d2c0904bdf8c
来源:简书

关键词:写法,空间

74
73
25
news

版权所有© 亿企邦 1997-2025 保留一切法律许可权利。

为了最佳展示效果,本站不支持IE9及以下版本的浏览器,建议您使用谷歌Chrome浏览器。 点击下载Chrome浏览器
关闭