1.多个图层数据查询。
请求体:[/size][/size]
<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="workspace:layername"/>
<wfs:Query typeName="workspace:layername1"/>
</wfs:GetFeature>
NOTE:图层可以来自不同工作空间。
2.根据矩形范围查询范围内原件。
<wfs:Query typeName="workspace: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="xxx">
<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="xx">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<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="layer">
<ogc:Filter>
<ogc:Or>
<ogc:And>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>xx</ogc:PropertyName>
<Literal>XXX</Literal>
</ ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>xx</ogc:PropertyName>
<Literal>XXX</Literal>
</ ogc:PropertyIsEqualTo>
</ogc:And>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>xx</ogc:PropertyName>
<Literal>XXX</Literal>
</ ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>xx</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>