OpenGIS
©
Specification OGC 04-094
Copyright © Open Geospatial Consortium, Inc 2005
40 9.4 Exceptions
In the event that a web feature service encounters an error servicing a GetFeature request, it shall raise an exception as described in subclause 7.7.
9.5 Examples
This section contains numerous examples of the GetFeature request. Some examples include sample output.
Example 1
This example fetches a specific instance of the feature type InWaterA_1M identified by the feature identifier InWaterA_1M.1234.
?xml version=1.0 ? wfs:GetFeature
service=WFS version=1.1.0
outputFormat=textxml; subtype=gml3.1.1 xmlns:myns=http:www.someserver.commyns
xmlns:wfs=http:www.opengis.netwfs xmlns:ogc=http:www.opengis.netogc
xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:www.opengis.netwfs ..wfs1.1.0WFS.xsd
wfs:Query typeName=myns:InWaterA_1M ogc:Filter
ogc:GmlObjectId gml:id=InWaterA_1M.1234 ogc:Filter
wfs:Query wfs:GetFeature
Example 2
This example fetches a subset of properties of the feature type InWaterA_1M. The specific instance that is retrieved by the request is identified by the feature identifier
InWaterA_1M.1013.
?xml version=1.0 ? wfs:GetFeature
service=WFS version=1.1.0
xmlns:wfs=http:www.opengis.netwfs xmlns:ogc=http:www.opengis.netogc
xmlns:myns=http:www.someserver.commyns xmlns:xsi=http:www.w3.org2001XMLSchema-instance
xsi:schemaLocation=http:www.opengis.netwfs ..wfs1.1.0WFS.xsd wfs:Query typeName=myns:InWaterA_1M
wfs:PropertyNamemyns:wkbGeomwfs:PropertyName wfs:PropertyNamemyns:tileIdwfs:PropertyName
wfs:PropertyNamemyns:facIdwfs:PropertyName ogc:Filter
ogc:GmlObjectId gml:id=InWaterA_1M.1013 ogc:Filter
wfs:Query wfs:GetFeature
Example 3
OpenGIS
©
Specification OGC 04-094
Copyright © Open Geospatial Consortium, Inc 2005
41
In this example, all the properties of feature type InWaterA_1M are fetched for an enumerated list of feature instances. The GmlObjectId element is used to identify
each feature to be fetched.
?xml version=1.0 ? GetFeature
version=1.1.0 service=WFS
xmlns=http:www.opengis.netwfs xmlns:ogc=http:www.opengis.netogc
xmlns:myns=http:www.someserver.commyns xmlns:xsi=http:www.w3.org2001XMLSchema-instance
xsi:schemaLocation=http:www.opengis.netwfs ..wfs1.1.0WFS.xsd Query typeName=myns:InWaterA_1M
ogc:Filter ogc:GmlObjectId gml:id=InWaterA_1M.1013
ogc:GmlObjectId gml:id=InWaterA_1M.1014 ogc:GmlObjectId gml:id=InWaterA_1M.1015
ogc:Filter Query
GetFeature
Example 4
This example is similar to the previous example except in this case only some of the properties of an enumerated set of features are fetched. The PropertyName element
is used to list the properties to be retrieved.
?xml version=1.0 ? GetFeature
version=1.1.0 service=WFS
xmlns=http:www.opengis.netwfs xmlns:ogc=http:www.opengis.netogc
xmlns:myns=http:www.someserver.commyns xmlns:xsi=http:www.w3.org2001XMLSchema-instance
xsi:schemaLocation=http:www.opengis.netwfs ..wfs1.1.0WFS.xsd Query typeName=myns:InWaterA_1M
wfs:PropertyNamemyns:wkbGeomwfs:PropertyName wfs:PropertyNamemyns:tileIdwfs:PropertyName
ogc:Filter ogc:GmlObjectId gml:id=InWaterA_1M.1013
ogc:GmlObjectId gml:id=InWaterA_1M.1014 ogc:GmlObjectId gml:id=InWaterA_1M.1015
ogc:Filter Query
GetFeature
Example 5
Select all instances of the feature type InWaterA_1M to a maximum of 10000 features.
?xml version=1.0 ? GetFeature
version=1.1.0 service=WFS
maxFeatures=10000 xmlns=http:www.opengis.netwfs
xmlns:myns=http:www.someserver.commyns xmlns:xsi=http:www.w3.org2001XMLSchema-instance
xsi:schemaLocation=http:www.opengis.netwfs ..wfs1.1.0WFS.xsd Query typeName=myns:InWaterA_1M
GetFeature
Example 6