请求体 :
<wfs:GetFeature service="WFS" version="
1.1.0
"
xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="namespace:layername"/>
<wfs:Query typeName="namespace:layername"/>
</wfs:GetFeature>
NOTE:
图层可以来自不同工作空间。
2.
根据矩形范围查询范围内原件。
<wfs:Query typeName=" namespace:layername ">
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>geom</ogc:PropertyName>
<gml:Envelope
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:lowerCorner> 113.02452 23.74715 </gml:lowerCorner>
<gml:upperCorner>113.02454 23.74718</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</wfs:Query>
范围坐标参数顺序左下,右上。
3.WFS 请求某一圆周范围的地图要素
<wfs:GetFeature service="WFS" version="1.1.0"
xmlns:topp="http://www.openplans.org/topp"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ows="http://www.opengis.net/ows"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="namespace:layername ">
<ogc:Filter>
<ogc:DWithin>
<ogc:PropertyName>geom</ogc:PropertyName>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates>113.02452,23.74715</gml:coordinates>
</gml:Point>
<ogc:Distance>0.0001</ogc:Distance>
</ogc:DWithin>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
4. 根据属性值查询
<wfs:GetFeature service="WFS" version="1.1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ows="http://www.opengis.net/ows"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="namespace:layername ">
<ogc:Filter>
<ogc:PropertyName>sbmc</ogc:PropertyName>
<Literal>XXX 开关 </Literal>
</ ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
5. 根据属性值组合查询
<wfs:GetFeature service="WFS" version="1.1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ows="http://www.opengis.net/ows"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="namespace:layername ">
<ogc:Filter>
<ogc:Or>
<ogc:And>
<ogc:PropertyName>propertyname</ogc:PropertyName>
<Literal>XXX </Literal>
</ ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>propertyname</ogc:PropertyName>
<Literal>XXX </Literal>
</ ogc:PropertyIsEqualTo>
</ogc:And>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>propertyname</ogc:PropertyName>
<Literal>XXX </Literal>
</ ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>propertyname</ogc:PropertyName>
<Literal>XXX </Literal>
</ ogc:PropertyIsEqualTo>
</ogc:Or>
</wfs:Query>
</wfs:GetFeature>
1) Equal :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsEqualTo><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsEqualTo>
2) NotEqual :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsNotEqualTo><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsNotEqualTo>
3) Less :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsLessThan><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsLessThan>
4) Greater :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsGreaterThan><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsGreaterThan>
5) LessOrEqual :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsLessThanOrEqualTo><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsLessThanOrEqualTo>
6) GreaterOrEqual :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsGreaterThanOrEqualTo><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsGreaterThanOrEqualTo>
7) Like :第一个 %s 填写字段名称,第二个 %s 填写字段值
<PropertyIsLike wildCard="*" singleChar="?" escapeChar="/"><PropertyName>%s</PropertyName><Literal>%s</Literal></PropertyIsLike>
8) IsNull :第一个 %s 填写字段名称
<PropertyIsNull><PropertyName>%s</PropertyName></PropertyIsNull>
9) Between :第一个 %s 填写字段名称,第二个 %s 填写字段值下限,第三个 %s 填写字段值上限
<PropertyIsBetween><PropertyName>%s</PropertyName><LowerBoundary>%s</LowerBoundary><UpperBoundary>%s</UpperBoundary></PropertyIsBetween>
综上所述, ② 的例子中属性查询语句部分可以直接写成:
<And><PropertyIsLike wildCard="*" singleChar="?" escapeChar="/"><PropertyName>name</PropertyName><Literal> 新百商场 *</Literal></PropertyIsLike><PropertyIsEqualTo><PropertyName>kind</PropertyName><Literal>2200</Literal></PropertyIsEqualTo></And>