GeoServer的WFS空间查询

版权声明:欢迎评论和转载,转载请注明来源。 https://blog.csdn.net/zy332719794/article/details/52171149

在网上搜了很久,没有找到靠谱的代码,于是参考各种资料终于测试出其格式


点查询:

http://***:8060/geoserver/**/ows?service=WFS&request=GetFeature&version=1.0.0
    &typeName=图层服务名称&maxFeatures=2000&outputFormat=json&filter=
    <Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
        <Intersects>
            <PropertyName>GEOM</PropertyName>
            <gml:Point>
                <gml:coordinates>113.8037,34.43554</gml:coordinates>
            </gml:Point>
        </Intersects>
    </Filter>
线查询:
http://***:8060/geoserver/**/ows?service=WFS&request=GetFeature&version=1.0.0
    &typeName=图层服务名称&maxFeatures=2000&outputFormat=json&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>
面查询:
http://***:8060/geoserver/**/ows?service=WFS&request=GetFeature&version=1.0.0
	&typeName=图层服务名称&maxFeatures=2000&outputFormat=json&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>

这里如果需要进行属性查询,可添加属性查询条件:

 var url = *** +'geoserver/**/ows?' 
            + 'service=WFS&request=GetFeature&version=1.0.0&typeName=图层服务名称&maxFeatures=1&outputFormat=json'
		+ '&FILTER=<Filter>' 
		+ '<And>'
		+ '<PropertyIsEqualTo><PropertyName>ST_NAME</PropertyName><Literal>' + stName + '</Literal></PropertyIsEqualTo>'
		+ '<PropertyIsEqualTo><PropertyName>NAME</PropertyName><Literal>' + setloc + '</Literal></PropertyIsEqualTo>' 
		+ '</And>'
<pre name="code" class="html">		<span style="font-family: Arial, Helvetica, sans-serif;">+ '</Filter>';</span>
 
  


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值