to the National Atlas Home page
About | Fact Sheets | Contact Us | Partners | Products | Site Map | FAQ | Help | Follow us on Twitter 
Part of Project LogoAgricultureBiologyBoundariesClimateEnvironmentGeologyGovernmentHistoryMappingPeopleTransportationWater
to the Interactive Map MakerMap LayersPrintable MapsWall MapsDynamic MapsArticlesMapping Professionals

Technical Information About the 1 Experimental Web Feature Service


Web Feature Service Introduction

 

These instructions are for mapping professionals who want to retrieve basic cartographic features at one million-scale from nationalatlas.gov™. We call this collection of fundamental map layers 1. Our 1 Web Feature Service (WFS) adheres to the current specification from the Open Geospatial Consortium (OGC). Anyone can connect to this service from the National Atlas of the United States® by supplying valid OGC parameter values to our Web services uniform resource locator (URL).

An Introduction to the 1 Experimental Web Feature Service is also available that provides step-by-step instructions for using the service in Esri ArcGIS and Intergraph GeoMedia.

Using the 1 WFS from the National Atlas

arrow downGeneral Information About the 1 WFS
arrow down1 WFS Boundaries Layers
arrow down1 WFS Transportation Layers
arrow downAccessing the Capabilities File: The GetCapabilities Request
arrow downGetting Field Information: The DescribeFeatureType Request
arrow downGetting Layer Features: The GetFeature Request
 
 

General Information About the 1 WFS

back to toptop of page

1 Web Feature Service Layers

The table below describes the available 1 Web Feature Service layers.

Boundaries

Map Layer Web Feature Service Request Web Feature Service URL Size Metadata
Congressional Districts of the United States - 113th Congress GetFeature http://webservices.nationalatlas.gov/arcgis/services/cgd113p010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=cgd113p010g 63.2 MB View metadata
GetCapabilities http://webservices.nationalatlas.gov/arcgis/services/cgd113p010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities
DescribeFeatureType http://webservices.nationalatlas.gov/arcgis/services/cgd113p010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType

Transportation

Map Layer Web Feature Service Request Web Feature Service URL Size Metadata
Airports GetFeature http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g 984 KB View metadata
GetCapabilities http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities
DescribeFeatureType http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType
Ports GetFeature http://webservices.nationalatlas.gov/arcgis/services/portsx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=portsx010g 162 KB View metadata
GetCapabilities http://webservices.nationalatlas.gov/arcgis/services/portsx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities
DescribeFeatureType http://webservices.nationalatlas.gov/arcgis/services/portsx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType
Railroad and Bus Passenger Stations GetFeature http://webservices.nationalatlas.gov/arcgis/services/amtrakx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=amtrakx010g 708 KB View metadata
GetCapabilities http://webservices.nationalatlas.gov/arcgis/services/amtrakx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities
DescribeFeatureType http://webservices.nationalatlas.gov/arcgis/services/amtrakx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType

Table 1: 1 WFS layers.

back to toptop of page

Accessing the Capabilities File: The GetCapabilities Request

Use the GetCapabilities addresses in Table 1 (middle row of each layer) to access the capabilities file for the layers of interest to you. Details of the GetCapabilities Request parameters are included in Table 2, below.

 Parameter Description Required/
Optional
 Valid Values  Default Value
SERVICE=WFS The name of the service. In this case, Web Feature Service. Required WFS  
REQUEST=GetCapabilities The type of request. Required GetCapabilities  
VERSION=version The version of the request. Optional 1.1.0, 1.0.0 1.1.0

Table 2: GetCapabilities Request Parameters

GetCapabilities Example

Using the airports map layer as an example, the GetCapabilities request would be:

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities

and the resulting Capabilites file would look like this:

<wfs:WFS_Capabilities version="1.1.0" xsi:schemaLocation="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/gml.xsd http://www.opengis.net/ogc http://schemas.opengis.net/filter/1.1.0/filter.xsd http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsAll.xsd http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" 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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:airprtx010g="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer">
   <ows:ServiceIdentification>
      <ows:Title>Airports of the United States</ows:Title>
      <ows:Abstract>This Web Feature Service delivers airports in the United States, Puerto Rico and the U.S. Virgin Islands. The data were derived from an extract of the Public-Use Airports database of the National Transportation Atlas Databases-2010 (NTAD-2010), published by the Bureau of Transportation Statistics, Department of Transportation.</ows:Abstract>
      <ows:Keywords>
         <ows:Keyword>Transportation, Airports</ows:Keyword>
      </ows:Keywords>
      <ows:ServiceType>WFS</ows:ServiceType>
      <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion>
      <ows:Fees>none</ows:Fees>
      <ows:AccessConstraints>none</ows:AccessConstraints>
   </ows:ServiceIdentification>
   <ows:ServiceProvider>
      <ows:ProviderName>National Atlas of the United States</ows:ProviderName>
      <ows:ProviderSite xlink:href="http://nationalatlas.gov/infodocs/wfs_intro.html" />
      <ows:ServiceContact>
         <ows:IndividualName/>
         <ows:PositionName>WFS Support Staff</ows:PositionName>
         <ows:ContactInfo>
            <ows:Phone>
               <ows:Voice/>
               <ows:Facsimile/>
            </ows:Phone>
            <ows:Address>
               <ows:DeliveryPoint/>
               <ows:City/>
               <ows:AdministrativeArea/>
               <ows:PostalCode/>
               <ows:Country/>
               <ows:ElectronicMailAddress>atlasmail@usgs.gov</ows:ElectronicMailAddress>
            </ows:Address>
            <ows:HoursOfService/>
            <ows:ContactInstructions>During the business week, email replies are typically issued within 24 hours of receipt of inquiries.</ows:ContactInstructions>
         </ows:ContactInfo>
      </ows:ServiceContact>
   </ows:ServiceProvider>
   <ows:OperationsMetadata>
      <ows:Operation name="GetCapabilities">
         <ows:DCP>
            <ows:HTTP>
               <ows:Get xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?" />
               <ows:Post xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer" />
            </ows:HTTP>
         </ows:DCP>
         <ows:Parameter name="AcceptVersions">
            <ows:Value>1.1.0</ows:Value>
            <ows:Value>1.0.0</ows:Value>
         </ows:Parameter>
         <ows:Parameter name="AcceptFormats">
            <ows:Value>text/xml</ows:Value>
         </ows:Parameter>
      </ows:Operation>
      <ows:Operation name="DescribeFeatureType">
         <ows:DCP>
         <ows:HTTP>
            <ows:Get xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?" />
            <ows:Post xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer" />
         </ows:HTTP>
         </ows:DCP>
         <ows:Parameter name="outputFormat">
            <ows:Value>text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0</ows:Value>
         </ows:Parameter>
      </ows:Operation>
      <ows:Operation name="GetFeature">
         <ows:DCP>
            <ows:HTTP>
               <ows:Get xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?" />
               <ows:Post xlink:href="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer" />
            </ows:HTTP>
         </ows:DCP>
         <ows:Parameter name="resultType">
            <ows:Value>results</ows:Value>
            <ows:Value>hits</ows:Value>
         </ows:Parameter>
         <ows:Parameter name="outputFormat">
            <ows:Value>text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0</ows:Value>
         </ows:Parameter>
      </ows:Operation>
      <ows:ExtendedCapabilities>
         <ows:Constraint name="serviceAxisOrderForSwappableSRS">
            <ows:Value>latitude,longitude</ows:Value>
         </ows:Constraint>
      </ows:ExtendedCapabilities>
   </ows:OperationsMetadata>
   <wfs:FeatureTypeList>
      <wfs:FeatureType>
         <wfs:Name>airprtx010g:airprtx010g</wfs:Name>
         <wfs:Title>airprtx010g</wfs:Title>
         <wfs:DefaultSRS>urn:ogc:def:crs:EPSG:6.9:4269</wfs:DefaultSRS>
         <wfs:OtherSRS>urn:ogc:def:crs:EPSG:6.9:4326</wfs:OtherSRS>
         <wfs:OutputFormats>
            <wfs:Format>text/xml; subType=gml/3.1.1/profiles/gmlsf/1.0.0/0</wfs:Format>
         </wfs:OutputFormats>
         <ows:WGS84BoundingBox>
            <ows:LowerCorner>-176.64603099983063 17.701555999609866</ows:LowerCorner>
            <ows:UpperCorner>-64.801722000170003 71.285448000425049</ows:UpperCorner>
         </ows:WGS84BoundingBox>
      </wfs:FeatureType>
   </wfs:FeatureTypeList>
   <ogc:Filter_Capabilities>
      <ogc:Spatial_Capabilities>
         <ogc:GeometryOperands>
            <ogc:GeometryOperand>gml:Envelope</ogc:GeometryOperand>
            <ogc:GeometryOperand>gml:Point</ogc:GeometryOperand>
            <ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand>
            <ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand>
         </ogc:GeometryOperands>
         <ogc:SpatialOperators>
            <ogc:SpatialOperator name="BBOX"/>
            <ogc:SpatialOperator name="Equals"/>
            <ogc:SpatialOperator name="Disjoint"/>
            <ogc:SpatialOperator name="Intersects"/>
            <ogc:SpatialOperator name="Crosses"/>
            <ogc:SpatialOperator name="Touches"/>
            <ogc:SpatialOperator name="Within"/>
            <ogc:SpatialOperator name="Contains"/>
            <ogc:SpatialOperator name="Overlaps"/>
         </ogc:SpatialOperators>
      </ogc:Spatial_Capabilities>
      <ogc:Scalar_Capabilities>
         <ogc:LogicalOperators/>
         <ogc:ComparisonOperators>
            <ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>NotEqualTo</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>Like</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>Between</ogc:ComparisonOperator>
            <ogc:ComparisonOperator>NullCheck</ogc:ComparisonOperator>
         </ogc:ComparisonOperators>
      </ogc:Scalar_Capabilities>
      <ogc:Id_Capabilities>
         <ogc:EID/>
         <ogc:FID/>
      </ogc:Id_Capabilities>
   </ogc:Filter_Capabilities>
</wfs:WFS_Capabilities>

Figure 1: Sample output from a GetCapabilities request.

back to toptop of page

Getting Field Information: The DescribeFeatureType Request

To get information such as field names, data types, or any constraints set on the field, use one of the DescribeFeatureType requests in Table 1 (third row of each layer) for your layer of interest. Table 3 describes each parameter in the DescribeFeatureType request.

 Parameter Description Required/
Optional
 Valid Values
SERVICE=WFS The name of the service. In this case, Web Feature Service. Required WFS
REQUEST=DescribeFeatureType The type of request. Required DescribeFeatureType
VERSION=version The version of the request. Required 1.1.0

Table 3: Details of the DescribeFeatureType Request

DescribeFeatureType Example

Using the airports map layer as an example, the DescribeFeatureType request would be:

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType

and the results would look like this:

<xs:schema targetNamespace="http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer" elementFormDefault="qualified">
   <xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
   <xs:element name="airprtx010g" type="airprtx010g:airprtx010gType" substitutionGroup="gml:_Feature"/>
   <xs:complexType name="airprtx010gType">
      <xs:complexContent>
         <xs:extension base="gml:AbstractFeatureType">
            <xs:sequence>
               <xs:element name="OBJECTID" type="xs:int"/>
               <xs:element minOccurs="0" name="Shape" type="gml:PointPropertyType"/>
               <xs:element minOccurs="0" name="AIRPRTX010" type="xs:double"/>
               <xs:element minOccurs="0" name="FEATURE">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="ICAO">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="IATA">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="AIRPT_NAME">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="254"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="CITY">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="254"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="STATE">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="5"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="STATE_FIPS">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="5"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="COUNTY">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="254"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="FIPS">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="5"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="TOT_ENP" type="xs:double"/>
               <xs:element minOccurs="0" name="LATITUDE" type="xs:double"/>
               <xs:element minOccurs="0" name="LONGITUDE" type="xs:double"/>
               <xs:element minOccurs="0" name="ELEV" type="xs:double"/>
               <xs:element minOccurs="0" name="ACT_DATE">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
               <xs:element minOccurs="0" name="CNTL_TWR">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:maxLength value="5"/>
                     </xs:restriction>
                  </xs:simpleType>
               </xs:element>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>
</xs:schema>

Figure 2: Sample output from a DescribeFeatureType request.

back to toptop of page

Getting Layer Features: The GetFeature Request

To get layer features, use one of the GetFeature requests in Table 1 (top row of each layer) for your layer of interest. Table 4 describes each parameter in the GetFeature request. You can add optional parameters by appending an ampersand (&) to the GetFeature URL in Table 1 followed by a valid parameter/value pair.

 Parameter Description Required/
Optional
 Valid Values
SERVICE=WFS The name of the service. In this case, Web Feature Service. Required WFS
REQUEST=GetFeature The type of request. Required GetFeature
VERSION=version The version of the request. Required 1.1.0
TypeName=
<name of feature type>
The name of the feature type you are requesting. Required This value is defined in the GetCapabilities file, in the FeatureTypeList section.
srsName=EPSG:id_code Spatial Reference System (SRS) identifier. Optional Hundreds of spatial reference systems are supported. However, some GIS clients will return an error if the EPSG code supplied with the srsName parameter is not specified in the capabilities file. Currently, the capabilities files include only EPSG:4269 (the default) and EPSG:4326.
maxFeatures=N The maximum number of features to return. Optional A positive integer.
featureID=
<FeatureType>.<gml:id>

Request a specific feature by its ID number. <FeatureType> is the name of the feature type. <gml:id> is the ID number of the feature of interest and typically follows the following format: "F##__##." Several features can be returned by separating the <FeatureType>.<gml:id> values with commas.

Cannot be used in conjunction with BBOX or filter.

Optional The <FeatureType> name is defined in the GetCapabilities file, in the FeatureTypeList section. The <gml:id> is defined within the data file.
BBOX=minx,miny,
maxx,maxy

Bounding box corners (lower left, upper right) in the coordinates of the map layer's projection. The National Atlas WFS map layers use the EPSG:4269 projection.

Note that if you use the EPSG:4326 spatial reference system, map coordinates are ordered by latitude, longitude (y,x) in the WFS 1.1 specification so you would enter the BBOX coordinates as miny, minx, maxy, maxx.

Cannot be used in conjunction with featureID or filter.

Optional Four comma-delimited numeric values. The full extent of National Atlas layers, in the EPSG:4269 projection, is:
-180,0,0,90
resultType=<type> Returns either the number of results from the query (resultType=hits) or returns the actual query results (resultType=results). When using resultType=hits, the number of results is displayed using the "numberOfFeatures" attribute. Optional hits, results
filter=<XML string
that includes the
filter query>

Applies a filter to data. You must encode the filter query as an XML-formatted string. See the OGC Filter Encoding Specification for more information on the syntax of the filter parameter.

Cannot be used in conjunction with BBOX or featureID.

Optional

The following geometry operands are supported:
Envelope, Point, Polygon, LineString.

The following geometry operators are supported:
BBOX, Equals, Disjoint, Intersects, Crosses, Touches, Within, Contains, Overlaps.

The following Comparison operators are supported:
EqualTo, NotEqualTo, LessThan, GreaterThan, LessThanEqualTo, GreaterThanEqualTo, Like, Between, NullCheck.

The following Logical Filters are supported: AND, OR, NOT

Table 4: Details of the GetFeature Request

GetFeature Examples

The GetFeatures examples on this page use the airports map layer. Output from the GetFeatures request will look similar to the following (Figure 3).

<wfs:FeatureCollection xsi:schemaLocation="http://vagsw1.er.usgs.gov:8399/arcgis/services/airprtx010g/MapServer/WFSServer http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?request=DescribeFeatureType%26version=1.1.0%26typename=airprtx010g http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
   <gml:boundedBy>
      <gml:Envelope srsName="urn:ogc:def:crs:EPSG:6.9:4269">
         <gml:lowerCorner>17.701555999609866 -176.64603099983063</gml:lowerCorner>
         <gml:upperCorner>71.285448000425049 -64.801722000170003</gml:upperCorner>
      </gml:Envelope>
   </gml:boundedBy>
   <gml:featureMember>
      <airprtx010g:airprtx010g gml:id="F3__1">
         <airprtx010g:OBJECTID>1</airprtx010g:OBJECTID>
         <airprtx010g:Shape>
            <gml:Point>
               <gml:pos>41.330055999584879 -72.045138999565026</gml:pos>
            </gml:Point>
         </airprtx010g:Shape>
         <airprtx010g:AIRPRTX010>0</airprtx010g:AIRPRTX010>
         <airprtx010g:FEATURE>AIRPORT</airprtx010g:FEATURE>
         <airprtx010g:ICAO>KGON</airprtx010g:ICAO>
         <airprtx010g:IATA>GON</airprtx010g:IATA>
         <airprtx010g:AIRPT_NAME>GROTON-NEW LONDON AIRPORT</airprtx010g:AIRPT_NAME>
         <airprtx010g:CITY>GROTON (NEW LONDON)</airprtx010g:CITY>
         <airprtx010g:STATE>CT</airprtx010g:STATE>
         <airprtx010g:STATE_FIPS>09</airprtx010g:STATE_FIPS>
         <airprtx010g:COUNTY>NEW LONDON</airprtx010g:COUNTY>
         <airprtx010g:FIPS>09011</airprtx010g:FIPS>
         <airprtx010g:TOT_ENP>75</airprtx010g:TOT_ENP>
         <airprtx010g:LATITUDE>41.330055999999999</airprtx010g:LATITUDE>
         <airprtx010g:LONGITUDE>-72.045139000000006</airprtx010g:LONGITUDE>
         <airprtx010g:ELEV>9</airprtx010g:ELEV>
         <airprtx010g:ACT_DATE>04/1940</airprtx010g:ACT_DATE>
         <airprtx010g:CNTL_TWR>Y</airprtx010g:CNTL_TWR>
      </airprtx010g:airprtx010g>
   </gml:featureMember>
   ...
</wfs:FeatureCollection>

Figure 3: Sample output from a GetFeatures request. The first feature in the airports map layer is detailed. Note the highlighted gml:id attribute ("F3__1" in the example); the gml:id attribute is used in the featureID parameter. Complex queries can be made using the filter parameter. Example 5 shows how to use the filter parameter to create a query on the "ELEV" attribute.

Example 1, Using the maxFeatures parameter:
The following URL returns the first 10 airports in the airports map layer. The order is determined by the order in the data file itself.

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g&maxFeatures=10

Example 2, Using the featureID parameter:
The following URL returns the information for two airports by referencing each airport's featureID (each airport's feature ID is separated by a comma). Note that the feature ID is the feature name plus the gml:id number. See the highlighted gml:id in Figure 3 to get an example of what the gml:id number looks like. You may need to do a basic GetFeature request first to find the gml:id, and then use the gml:id in the featureID parameter.

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&featureID=airprtx010g.F3__1,airprtx010g.F3__2

Example 3, Using the BBOX parameter:
The following URL returns the information for all airports in the region contained within the Bounding Box coordinates.

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g&BBOX=-160.75,22.5,-154.5,18.5

Example 4, Using the resultType parameter:
The following URL returns the number of results that would be returned from the BBOX query above. The output is shown in Figure 4.

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g&BBOX=-160.75,22.5,-154.5,18.5&resultType=hits



<wfs:FeatureCollection numberOfFeatures="11" timeStamp="4/26/2013 12:53:31 PM" xsi:schemaLocation="http://vagsw1.er.usgs.gov:8399/arcgis/services/airprtx010g/MapServer/WFSServer http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?request=DescribeFeatureType%26version=1.1.0%26typename=airprtx010g http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"/>

Figure 4: Output from a GetFeature request that uses the resultType=hits parameter. The numberOfFeatures attribute, which reports the number of features that would be returned, is highlighted.

Example 5, Using the filter parameter:
If you want to find all airports with an elevation of 7,000 feet or higher, you might use the following XML Filter Expression:

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc/filter/1.0.0/filter.xsd http://www.opengis.net/gml/2.1/geometry.xsd">
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>ELEV</ogc:PropertyName>
<ogc:Literal>7000</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
</ogc:Filter>

So, appending the filter parameter plus the XML Filter Expression to the GetFeature URL would result in the following:

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g&filter=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc/filter/1.0.0/filter.xsd http://www.opengis.net/gml/2.1/geometry.xsd"><ogc:PropertyIsGreaterThanOrEqualTo><ogc:PropertyName>ELEV</ogc:PropertyName><ogc:Literal>7000</ogc:Literal></ogc:PropertyIsGreaterThanOrEqualTo></ogc:Filter>

However, it is usually best to encode special characters such as "<", ">", quote marks and spaces using their hexadecimal character codes. Replacing "<" with its hexadecimal value "%3C", ">" with its hexadecimal value "%3E", quote marks with the hexadecimal value "%22", and spaces with the hexadecimal value "%20", results in the following URL:

http://webservices.nationalatlas.gov/arcgis/services/airprtx010g/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TypeName=airprtx010g&filter=%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%20xmlns:gml=%22http://www.opengis.net/gml%22%20xmlns:xsi=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsi:schemaLocation=%22http://www.opengis.net/ogc/filter/1.0.0/filter.xsd%20http://www.opengis.net/gml/2.1/geometry.xsd%22%3E%3Cogc:PropertyIsGreaterThanOrEqualTo%3E%3Cogc:PropertyName%3EELEV%3C/ogc:PropertyName%3E%3Cogc:Literal%3E7000%3C/ogc:Literal%3E%3C/ogc:PropertyIsGreaterThanOrEqualTo%3E%3C/ogc:Filter%3E

More information on the filter parameter can be found on the OGC Web site.

back to toptop of page