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.
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
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 |
GetCapabilities Example
Using the airports map layer as an example, the GetCapabilities request would be:
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>
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 |
DescribeFeatureType Example
Using the airports map layer as an example, the DescribeFeatureType request would be:
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>
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: The following geometry operators are supported: The following Comparison operators are supported: The following Logical Filters are supported: AND, OR, NOT |
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).
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.
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.
Example 3, Using the BBOX parameter:
The following URL returns the information for all airports in the region
contained within the Bounding Box coordinates.
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.
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:
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:
More information on the filter parameter can be found on the OGC Web site.
National Atlas of the United States® and The National Atlas of the United States of America® are registered trademarks of the United States Department of the Interior Contact Us Privacy Statement, Disclaimer, Accessibility, FOIA http://nationalatlas.gov/infodocs/wfs_techinfo.html Last modified: Monday, 30-Jun-2014 20:40:00 CDT |