airnow web services data to go! prepared by steven a. ludewig, timothy s. dye sonoma technology,...
TRANSCRIPT
AIRNow Web ServicesData to Go!
Prepared bySteven A. Ludewig, Timothy S. Dye
Sonoma Technology, Inc.Petaluma, CA
John E. WhiteU.S. Environmental Protection Agency
Research Triangle Park, NC
Presented at the 2010 National Air Quality ConferencesRaleigh, NC
March 15-18, 2010
3800
2
AIRNow Web Services: Why Are They Needed?
• Web Services provide a way to retrieve data and information ‘on demand’ from the AIRNow system.– Forecasts– Action days– Observed data– Multiple format options including maps– Agency, reporting area, and monitoring site information
• Uses– Agency websites, web developer access– Local news organizations– Other agencies– Schools and researchers– Spreadsheets and other applications– The public
4
AIRNow Web Services
AIRNow System
Desktop Apps
Websites
Mobile Apps
Web Services enable the AIRNow repository to become the data source behind many types of software programs.
It meets the needs of web developers, news organizations, researchers, and the public.
It saves agency time – no need to deliver custom data sets or provide specific feeds to those requesting data.
Web Services
5
AIRNow Web Services
• Where we’ve been– Simple Object Access Protocol (SOAP): not
as simple or clean as it sounds
• Progress in 2009– A RESTful approach
• The future – an AIRNow Application Programming Interface (API)– Additional services, data sets, and formats
useful for building applications– An easier to use, well-documented interface
6
AIRNow Web Services: A RESTful Approach (1 of 2)
• REST = “REpresentational State Transfer”– The RESTful AIRNow Web Services use the URL – the web
address that we are all familiar with, e.g., http://www.airnow.gov”
– The URL represents a question asked of a computer system.– Example: Typing www.airnow.gov in the address line is
asking AIRNow to show us their home page. The web page is then returned and displayed on-screen.
Web Service questions can be much more specific than just “show me your web page” and the results can be more than just a display in the browser.
7
AIRNow Web Services: A RESTful Approach (2 of 2)
• Example question: “What is the current air quality forecast for my home town ZIP Code?”– URL: http://ws.airnowgateway.org/GatewayWebService
REST/Gateway.svc/forecastbyzipcode?key=43321E-F56Q-B612-68FBN&zipcode=95401&format=csv
• Looks complicated, but let’s break it down– ForecastByZIPCode = the name of this request*– Key = unique user key– ZIPCode = ZIP Code of interest– Format = payload options (CSV, JSON, KML, XML, etc.)– Optional: Date = any date of interest (defaults to the
current date)
*a companion service exists for observed data: ObservedByZIPCode
8
AIRNow Web Services
Use of ForecastByZIPCode and ObservedByZIPCode services by the EPA MyEnvironment website: www.epa.gov/myenvironment
9
AIRNow Web Services
• Question: “What are the current observed PM2.5 values for a geographic area in northern California?”– URL: http://ws.airnowgateway.org/demo/wcs/wcs.asmx/wcs?service=wcs&
Request=GetCoverage&identifier=point&aqsparamcode=44201&aqsdurationcode=1&poc=1&time_sequence=2010-02-27 00:00:00&bbox=40,-124,42,-122&format=csv&key=1A112F55-9B32-4C54-A81B-78D9C03A5
– Identifier = point (other options include time series and gridded data)
– AQSParamCode = 44201 (AQS parameter code for ozone)– AQSDurationCode = 1 (one hour)– POC = 1 (parameter occurrence code)– Time_Sequence = date/time of data– BBox = the geographic bounding box of the data
(latitude/longitude)– Format = payload format (CSV, AQCSV, KML, NetCDF )– Key = unique user key
10
AIRNow Web Services
Use of a geospatial Web Coverage Service (WCS) by Shasta County, CA: http://www.co.shasta.ca.us/html/ResMgmt/AQ/aq_map.aspx
KML file
11
AIRNow Web Services
• ForecastByZIPCode• ObservedByZIPCode • ForecastsByIssueDate• ActionDaysByDate• Ozone24HourAQI• PM25Mid24HrAQI
• ReportingAreaMax-AverageAQI
• SiteMaxAverageAQI
• SiteInfoByAQSCode • AgencyGetSites
• GetReportingAreas
Geospatial:• WCS – point • WCS – time series
Coming Soon:• WCS – grid • WMS – mapping service
Demonstration Tool
12
AIRNow Web Services – The Future
• AIRNow API– Expanded library of services– Additional geospatial services– More payload options– Improved standardization– Extensive documentation– Online query generator tools
13
AIRNow Web Services
Thank You!
Contact:Steven A. Ludewig John E. White(707) 665-9900 (919) [email protected]@epa.gov