WFS测试用例
一)GET方式
GetCapabilities操作
172.17.1.211:7001/mywfs45/wfs?version=1.0.0&service=wfs&request=getCapabilities
DescribeFeatureType操作
172.17.1.211:7001/mywfs45/wfs?version=1.0.0&service=wfs&request=DESCRIBEFEATURETYPE&typeName=bou1_4m_s
GetFeature操作
172.17.2.90:8989/mywfs45/wfs?version=1.1.0&service=wfs&request=getFeature&typeName=bou1_4m_s&maxFeatures=5&outputFormat=GML3
2.根据范围查询
172.17.2.90:8989/mywfs45/wfs?version=1.1.0&service=wfs&request=getFeature&typeName=bou1_4m_s&BBOX=120,25,121,28&maxFeatures=5&outputFormat=GML3
3.根据Id查询
172.17.2.90:8989/mywfs45/wfs?version=1.1.0&service=wfs&request=getFeature&typeName=bou1_4m_s&FEATUREID=bou1_4m_s.80&maxFeatures=5&outputFormat=GML3
4.Filter查询
172.17.2.90:8989/mywfs45/wfs?version=1.1.0&service=wfs&request=getFeature&typeName=bou1_4m_s&PROPERTYNAME=NAME&outputFormat=GML3&FILTER=<ogc:Filter%20xmlns:ogc="www.opengis/ogc"><ogc:FeatureId%20fid="bou1_4m_s.90"/></ogc:Filter>
172.17.2.90:8989/mywfs45/wfs?version=1.1.0&service=wfs&request=getFeature&t
ypeName=bou1_4m_s&PROPERTYNAME=NAME&outputFormat=GML3&maxFeatures=5&FILTER=<ogc:Filter%20xmlns:ogc="www.opengis/ogc"><ogc:BBOX xmlns:gml="www.opengis/gml"><gml:Envelope><gml:lowerCorner>120 20</gml:lowerCorner><gml:upperCorner>130 40</gml:upperCorner></gml:Envelope></ogc:BBOX></ogc:Filter>
二)POST方式
***outputFormat 属性指定GML的输出标准,可选值有:"text/xml; subtype=gml/3.1.1"、"GML2"、 DescribeFeatureType操作
<?xml version="1.0" encoding="UTF-8"?>
屋脊线
<DescribeFeatureType xmlns="www.opengis/wfs" xmlns:xsi="/2001/XMLSchema-instance"
service="WFS" version="1.1.0" outputFormat="text/xml;subtype=gml/3.1.1">
中国农民
调查 pdf
<TypeName>BOU1_4M_L</TypeName></DescribeFeatureType>GetFeature操作
1.根据typeName查询所有属性,最大返回五条记录
<?xml version="1.0" encoding="UTF-8"?>
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs"
xmlns:ogc="www.opengis/ogc"
xmlns:gml="www.opengis/gml">
<Query typeName="BOU1_4M_S">
</Query>
洛阳师范学院学报</GetFeature>
2.根据typeName查询部分属性
<?xml version="1.0" encoding="UTF-8"?>
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs"
xmlns:ogc="www.opengis/ogc"
xmlns:gml="www.opengis/gml">
<Query typeName="BOU1_4M_S">
<ogc:PropertyName>AREA</ogc:PropertyName>
<ogc:PropertyName>NAME</ogc:PropertyName>
</Query>
</GetFeature>
3.点查询
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs" 大脑肥胖症
xmlns:ogc="www.opengis/ogc"
企业竞争情报系统
xmlns:gml="www.opengis/gml">
<Query typeName="BOU1_4M_S">
<ogc:PropertyName>GEOMETRY</ogc:PropertyName>
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Filter xmlns:ogc="www.opengis/ogc">
<ogc:Intersects>
<gml:Point xmlns:gml="www.opengis/gml">
<gml:coordinates>120,30</gml:coordinates>
</gml:Point>
</ogc:Intersects>
</ogc:Filter>
</Query>
</GetFeature>
4.矩形查询
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs"
xmlns:ogc="www.opengis/ogc"
xmlns:gml="www.opengis/gml">
<Query typeName="BOU1_4M_S">
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Filter xmlns:ogc="www.opengis/ogc">
<ogc:BBOX>
<gml:Envelope>
<gml:lowerCorner>80 10</gml:lowerCorner>
<gml:upperCorner>130 50</gml:upperCorner>
</gml:Envelope>
</ogc:BBOX>
</ogc:Filter>
</Query>
</GetFeature>
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs"
xmlns:ogc="www.opengis/ogc"
xmlns:gml="www.opengis/gml">
上海市劳动合同条例
<Query typeName="BOU1_4M_S">
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Filter xmlns:ogc="www.opengis/ogc">
<ogc:BBOX>
<gml:box>
<gml:coordinates>100,30 110,40</gml:coordinates>
</gml:box>
</ogc:BBOX>
</ogc:Filter>
</Query>
</GetFeature>
5.圆查询
<GetFeature version="1.1.0" service="WFS" maxFeatures="5" outputFormat="text/xml; subtype=gml/3.1.1"
xmlns="www.opengis/wfs"
xmlns:ogc="www.opengis/ogc"
xmlns:gml="www.opengis/gml">