National Digital Forecast Database (NDFD) Experimental Web Feature Service (WFS)
NOAA's National Weather Service offers several XML services
|Forecasts||Watch/warnings||Current Observations||Tropical Cyclone Advisories||Storm Prediction Center Forecast Products||Change Notices|
- What is the NDFD WFS?
- Why provide an NDFD WFS?
- How often is NDFD WFS data updated?
- How is NDFD dwGML generated?
- What does NDFD dwGML contain?
- How Do You Use the WFS?
- What filter capability exists?
- Tutorials describing the use of various clients
- What if I need lots of NDFD data
- What if I prefer not to use a WFS to access NDFD web services?
- NWS XML Services Change Notices
- Additional Background Material
What is the NDFD WFS?
The National Digital Forecast Database (NDFD) experimental Web Feature
Service (WFS) is based on the Open
Geospatial Consortium WFS standard and provides the public, government agencies, and
commercial enterprises with data from the National Weather Service’s (NWS) digital
forecast database. This service, which is defined in a Service
Description Document, provides NWS customers and partners the ability to request NDFD
data over the internet and receive the information back in a Geography Markup Language (GML)
format which is also a Open
Geospatial Consortium standard. The request/response process is made possible by the
NDFD WFS server. To learn more about the NDFD WFS, you can review the service's
capabilities document at the following URL:
http://www.weather.gov/forecasts/xml/OGC_services/ndfdOWSserver.php? SERVICE=WFS& Request=GetCapabilities
In addition to the WFS specification, this service exploits the GML standard to enhance the ease with which NWS
customers and partners can integrate NDFD data into their Geographical Information Systems (GIS).
GML allows its users to create languages with HTML-like tags and attributes. The NDFD
GML language is called Digital Weather Geography Markup Language (dwGML) and its application schema
can be found at the following links:
Compliant with GML2.1.2
Compliant with GML3.1.1
The application schema defines the GML language’s vocabulary (available tags and attributes)
and syntax (expected order of tags). Knowing how NDFD dwGML is constructed, GIS and user
written programs can process the document to get at the data it contains.
To see a sample dwGML/Keyhole Markup Language (KML) document for each of the features returned by the WFS, click on any of the following links:
- Forecast_Gml2Point (GML2.1.2 compliant data structure) with weather values summarized for each valid time
- Forecast_Gml2AllWx (GML2.1.2 compliant data structure) with up to 5 weather values for each valid time
- Forecast_GmlObs (GML3.1.1 compliant data structure based on the GML Observation element)
- NdfdMultiPointCoverages (GML3.1.1 compliant data structure based on the GML MultiPoint Coverage element). This is an efficient data structure for encoding large amounts of data.
- Ndfd_KmlPoint (KML encoded NDFD data). This file contains KML encoded NDFD data and is suitable for use with Google Earth.
Why provide an NDFD WFS?
The National Weather Service is striving to serve society’s needs for weather information
by evolving its services from a text-based paradigm to one based on making NWS information
available quickly, efficiently, and in convenient and understandable forms. The NDFD is
one example of this transformation. NDFD WFS takes yet another step towards a digital
services era by making NDFD data available for computer to computer transfer and processing.
NWS customers and partners can then use the data in their GIS. Once imported into the GIS,
NDFD data can be displayed, integrated with other data sets, and used to help create value-added
products to enhance the value of NDFD data.
You can provide comments on this web service from the following page.
http://www.weather.gov/survey/nws-survey.php?code=ndfd-wfs
How often is NDFD WFS data updated?
The NDFD data available to the WFS is updated hourly. We request developers using this service
for local applications only make a request for a specific point no more than once an hour. The
database is currently updated by 45 minutes after the hour.
How is NDFD dwGML generated?
The first step to providing dwGML is the creation of the NDFD. For more information on how
NDFD is created, visit the NDFD home page. With
NDFD data available, a user's GIS creates and sends a GetFeature request to the NDFD WFS server using
a HTTP Get method query string. The client's HTTP request is processed, creating the
dwGML document which is returned to the requesting application for processing. Figure 1
provides a graphical view of the process.
![NDFD WFS Client/Server Architecture](wfs_ClientServer.gif)
Figure 1. NDFD WFS Client/Server Architecture
What does NDFD dwGML contain?
NDFD dwGML contains forecasts for any combination of the meteorological parameters found in the database.
A complete list of the elements can be found at the following web address:
http://www.weather.gov/ndfd/technical.htm#elements
For additional information on NDFD parameter definitions and available time projection, please see
the NDFD technical page.
Users can retrieve all these NDFD parameters for a default time (current time plus 3 hours) and
set of locations (193 cities across the United States and its territories). The default time
is projected 3 hours into the future to ensure that data is available. By employing filtering
in the query string that invokes the service, a user can retrieve other times and locations
that are available in the NDFD database.
How Do You Use the Web Feature Service?
- Select a WFS1.0.0 or WFS1.1.0 client. NOTE: Each client has its own procedures for
retriving data from a WFS. The rest of these steps provide some of the actions that
the client may take care of without user knowledge or input.
- If required, the client sends a GetCapabilities request to the sevice endpoint. The following URL
provides a sample GetCapabilities request and returns the service capabilities document.
Compliant with WFS1.0.0 http://www.weather.gov/forecasts/xml/OGC_services/ndfdOWSserver.php? SERVICE=WFS &Request=GetCapabilities &VERSION=1.0.0
Compliant with WFS1.1.0 http://www.weather.gov/forecasts/xml/OGC_services/ndfdOWSserver.php? SERVICE=WFS &Request=GetCapabilities &VERSION=1.1.0
- If required, the client will then likely send a DescribeFeatureType request
(see above for example).
- Finally, the client sends a GetFeature request to which the server responds with a dwGML
docment.
- Default Cities Locations: Sample request to return all NDFD elements for the current time for a points in a
number of United States cities:
- List of Locations: Sample request to return maximum temperature, for a user specified time, in Washington, DC
and New YorK City, NY:
http://www.weather.gov/forecasts/xml/OGC_services/ndfdOWSserver.php?
SERVICE=WFS&
Request=GetFeature&
VERSION=1.0.0&
latLonList=38.85,-77.04 40.77,-73.98&
time=2007-03-16T23:00:00&
PropertyName=maxt&
TYPENAME=Forecast_Gml2Point
NOTE: To submit the above example, a user would have to change the date information to reflect the current date and time.
For a list of valid weather property name inputs see the NDFD Element Names Page.
- Subgrid of Locations: Sample request to return maximum temperature, for a user specified time, over a subgrid of
NDFD points:
http://www.weather.gov/forecasts/xml/OGC_services/ndfdOWSserver.php?
SERVICE=WFS&
Request=GetFeature&
VERSION=1.0.0&
bbox=43.00,-82.00 33.00,-72.00&
resolution=40&
time=2007-03-30T23:00:00&
PropertyName=maxt&
TYPENAME=Forecast_Gml2Point
NOTE: To submit the above example, a user would have to change the date information to reflect the current date and time.
For a list of valid weather property name inputs see the NDFD Element Names Page.
The bounding box input contains the latitude and longitude pairs for the lower and
upper corners of a rectangle representing the desired subgrid. A resolution input
can be provided with the bounding box input to adjust the number of data points
returned. The default value of 5 represents the base resolution of NDFD (5 km).
Resolution values larger than 5 represent lower resolution. As with all requests to
the NDFD WFS, then number of points returned can not exceed 200.
NOTE: The subgrid locations will only form a rectangle when viewed in the NDFD
projection applicable to the grid.
- The client parses the dwGML and makes its contents available for use.
All latitude and longitude values provided as input or in the output DWML are based on
the World Geodetic System 1984 (WGS84). For more inforation on the NDFD spatial reference
system see the NDFD Spatial Reference System page.
Please note: There is an NDFD Web Services user forum that might be able to help developers with
implementation language specific issues. The unofficial forum can be found at the following URL:
http://tech.groups.yahoo.com/group/NDFD_SOAP_Service/
What filter capability exists?
The NDFD WFS supports a limited filtering capability. Users can filter a feature based on the following:
Spatial Operators
- BBOX - Returns all the NDFD points in the rectangle defined by the lower left and upper right corners (see sample below).
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>position</ogc:PropertyName>
<gml:Box>
<gml:coordinates>
-92.41362120033287,35.04438743042018 -79.81671165030966,41.18264054448772
</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter>
- Within - Returns all the NDFD points in the rectangle defined by the lower left and upper right corners (see sample below).
<ogc:Filter>
<ogc:Within>
<ogc:PropertyName>ndfdGridPoint</ogc:PropertyName>
<gml:Envelope>
<gml:lowerCorner>-92.41362120033287 35.04438743042018</gml:lowerCorner>
<gml:upperCorner>-79.81671165030966 41.18264054448772</gml:upperCorner>
</gml:Envelope>
</ogc:Within>
</ogc:Filter>
- Equals - Returns the NDFD point corresponding to the coordinates element content (see sample below).
<ogc:Filter>
<ogc:Equals>
<ogc:PropertyName>Geometry</ogc:PropertyName>
<gml:Point>
<gml:coordinates>-77.07,38.98</gml:coordinates>
</gml:Point>
</ogc:Equals>
</ogc:Filter>
Comparison Operators
- PropertyIsEqualTo - Used to select a specific time (see sample below).
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
- PropertyIsBetween - Used to select all data at and between two dates/times (see sample below).
<ogc:Filter>
<ogc:PropertyIsBetween>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:LowerBoundary>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:LowerBoundary>
<ogc:UpperBoundary>
<ogc:Literal>2008-02-27T00:00:00</ogc:Literal>
</ogc:UpperBoundary>
</ogc:PropertyIsBetween>
</ogc:Filter>
- PropertyIsGreaterThan - Used to select a range of times following the time in the <ogc:Literal>2008-02-26T00:00:00</ogc:Literal> element and including all data into the future (see sample below).
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
- PropertyIsGreaterThanOrEqualTo - Used to select a range of times from the time in the <ogc:Literal>2008-02-26T00:00:00</ogc:Literal> element and including all data into the future (see sample below).
<ogc:Filter>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
</ogc:Filter>
- PropertyIsLessThan - Used to select all data for a range of times before, but not including, the time in the <ogc:Literal>2008-02-26T00:00:00</ogc:Literal> element (see sample below).
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
- PropertyIsLessThanOrEqualTo - Used to select all data for a range of times before, and including, the time in the <ogc:Literal>2008-02-26T00:00:00</ogc:Literal> element (see sample below).
<ogc:Filter>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:PropertyName>validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
</ogc:Filter>
Putting it all together, you can retrieve 1 NDFD element at 1 NDFD Point for 1 user selected time using a GetFeature request like the
following:
<?xml version=\"1.0\" ?>
<GetFeature xmlns=\"http://www.opengis.net/wfs\"
xmlns:ogc=\"http://www.opengis.net/ogc\"
xmlns:ndfd=\"http://www.weather.gov/mdl/survey/pgb_survey/dev/OGC_services\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd\"
service=\"WFS\" version=\"1.1.0\" >
<Query typeName=\"ndfd:Forecast_GmlsfPoint\">
<ogc:PropertyName>ndfd:wx</ogc:PropertyName>
<ogc:Filter>
<ogc:And>
<ogc:Equals>
<ogc:PropertyName>Geometry</ogc:PropertyName>
<gml:Point>
<gml:coordinates>-77.07,38.98</gml:coordinates>
</gml:Point>
</ogc:Equals>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>ndfd:validTime</ogc:PropertyName>
<ogc:Literal>2008-02-26T00:00:00</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
</Query>
</GetFeature>
Note: The date and time must be at least an hour into the future.
Tutorials showing how to use various compatible clients
Tutorials on integrating the NDFD WFS and clients like ArcGIS, Google Earth,
Google Maps, and uDig..
What if I need lots of NDFD data or find the web service too slow?
The NWS has developed a program called degrib that can output NDFD data encoded in DWML. Degrib is a C program
that allows you to visualize NDFD GRIB2 data and convert these binary files into other
formats. If you are a web service user who wants DWML-encoded data for a large number of NDFD points, degrib will
allow you to move the DWML-encoding process to your computer. By using degrib to process the NDFD data on a local
computer, you may be able to significantly improve the speed with which your program is able to ingest NDFD data. The NWS makes a
degrib executable available for Microsoft Windows PCs and the degrib source code available for compilation on other
computer operating systems. To download degrib software, visit the
URL http://www.nws.noaa.gov/mdl/degrib/register.php. Once you
have the degrib software running, you will need to maintain updated NDFD GRIB2 files.
For more information on downloading NDFD GRIB2 files from the NWS Telecommunication Operations Center, see the URL
http://www.nws.noaa.gov/mdl/degrib/dataloc.php.
For additional help on using degrib to convert NDFD GRIB2 files into
DWML see the degrib tutorial and
man page.
Additional Background Material
-
Paper titled "Disseminating National Weather Service digital forecasts using open
geospatial standards":
http://ams.confex.com/ams/87ANNUAL/techprogram/paper_117264.htm.
-
Article titled "Experimental Web Feature Service Added To Digital Services Pantheon" on
Pages 4 - 5 of the National Weather Service publication Aware:
http://www.weather.gov/om/Aware/pdfs/aware-spring07.pdf.
What if I prefer not to use a WFS to access NDFD web services?
Users can access NDFD data using an HTTP GET interface. This interface does not require the user to create a WFS client.
An example request (query string) for the DWMLgen and DMWLgenByDay functionality follow:
DWMLgen
http://weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php? &lat=38.99 &lon=-77.01 &product=time-series &begin=2004-01-01T00:00:00 &end=2011-12-03T00:00:00 &maxt=maxt
DWMLgenByDay
http://weather.gov/forecasts/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php? &lat=38.99 &lon=-77.01 &format=24+hourly &startDate=2007-12-03 &numDays=7
NOTE: To submit the above example, a user would have to change the date information to reflect the current date and time.
Using query strings like the ones above, a user can provide the non-WFS clients ndfdXMLclient.php and
ndfdBrowserClientByDay.php with the input described in the
NDFD SOAP service function tables.
These clients then return the same output as the SOAP functions but without the need to use the SOAP or WFS prototcols.
Users can also use the NDFD Simple Object Access protocol (SOAP). The NDFD SOAP service uses the
Worldwide Web Consortium (W3C)
SOAP specification to exchange
NDFD data between a SOAP client and the NDFD SOAP server. You can find out more information
on the SOAP service at the
NDFD SOAP Service Home page.
NWS XML Services Change Notices
![XML](https://webarchive.library.unt.edu/eot2008/20080920074815im_/http://www.weather.gov/images/xml.gif)
Below are listed recent change notices for NWS XML services.
A complete listing is available.
An RSS feed of the change notices is also available.
These notices are used to announce major changes, schema changes and new services.
|