tags:

views:

477

answers:

1

Hi All,

I'm trying to use the NDFD (National Digital Forecast Database) to get current temperature and relative humidity given a Lat and Long using their REST based service.

The issue at hand:

I can't match the 'current observation data' WITH the 'results' I get back from the REST-service.

The setup:

Location:
* Apple (1-infinite loop, Cupertino, California)
* Lat = 37.33; Lon = -122.03

If I issue the following REST-call:

http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?lat=37.33&lon=-122.03&product=time-series&begin=2009-06-21T17:12:35&end=2009-06-21T17:12:35&appt=appt&rh=rh&temp_r=temp_r&temp=temp

Note 1: I'm passing the begin and end time in UTC. They're the same because I'm looking for just a single-point-in-time: the latest observed temp and relative humidity.

AND, then compare it to what is the closet reporting stations (San Jose International Airport, CA - KSJC - 37.37N 121.93W) @ http://www.weather.gov/xml/current_obs/KSJC.xml

** I can never get them to MATCH. **

Note 2: The nearest reporting station is return back from the REST call as well, so I know I'm comparing Location apples to Location apples.

I've had two ideas:

1: I'm doing something wrong with how I'm passing in the begin/end times into the REST call...

2: You can't get 'current observed data' the way I'm trying to...

Lastly:

I've found a solution using outoftime's NOAA ruby lib , [it parses an observation stations YAML file to find the nearest one given Lat/Lng then goes directly to that station via its identifier i.e. http://www.weather.gov/xml/current_obs/KSJC.xml].... but it just feels like I may be missing something obvious here and would like to use the REST-based interface ;)

Any help or pointers would be appreciated!

Thanks!

+1  A: 

It looks like the service you are calling isn't for current data. Judging by the URL and the XML results it seems to be for forecasts. You can also put in future dates to get future forecast data. It expects the dates to be in the -0700 time zone according to the response. I'm not sure which service you should be calling to get the data you want though.

laz
Thanks Iaz! I appreciate the time to answer and help out... I've resigned myself to doing it based off the station data :)
killingmichael