是否存在使用过滤器从Geoserver请求GML图层的解决方案,例如使用bbox
:
http://localhost:8080/geoserver/tiger/ows?service=WFS&version=1.0.0&
request=GetFeature&typeName=tiger:poi&maxFeatures=50&
bbox=-74.0104611,40.70758763,-74.00153046439813,40.719885123828675
结果将根据用户输入的bbox
参数特定过滤边界框(lat / lon)。
结果:
<wfs:FeatureCollection xsi:schemaLocation="http://www.census.gov http://127.0.0.1:8080/geoserver/tiger/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=tiger%3Apoi http://www.opengis.net/wfs http://127.0.0.1:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<tiger:poi fid="poi.4">
<tiger:the_geom>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:coordinates decimal="." cs="," ts=" ">-74.00857344,40.71194565</gml:coordinates></gml:Point>
</tiger:the_geom>
<tiger:NAME>lox</tiger:NAME>
<tiger:THUMBNAIL>pics/22037884-Ti.jpg</tiger:THUMBNAIL>
<tiger:MAINPAGE>pics/22037884-L.jpg</tiger:MAINPAGE>
</tiger:poi></gml:featureMember>
</wfs:FeatureCollection>
现在出现问题,我想根据<tiger:NAME>lox</tiger:NAME>
过滤数据,已经尝试在请求时输入tiger:NAME=lox
作为参数,结果与输入无参数时相同。有解决方案吗?
答案 0 :(得分:2)
基于Filter Encoding with Spatial Filter within WFS-Request和Geoserver Filter。我发现有一个名为filter
的参数,值可以这样输入:
http://localhost:8080/geoserver/tiger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=tiger:poi&maxFeatures=2&filter=<PropertyIsEqualTo><PropertyName>NAME</PropertyName><Literal>lox</Literal></PropertyIsEqualTo>