How weather data is calculated where there is no weather station ?

  • 1
  • Question
  • Updated 6 years ago
How wunderground displays weather data for a place where no weather station is located ? Can someone elaborate please. Example: Wunderground displays weather data for a place with latitude,longitude 41°50'58.8"N 87°2'39.86"W which is in lake Michigan
Photo of santoshb

santoshb

  • 23 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of juanbond

juanbond

  • 20 Posts
  • 8 Reply Likes
The API will return data from the weather station nearest to the lat/lon you requested. In the case of the lat.lon you provided, the nearest station is in Michigan City, Indiana. Most if not all API responses will show info on what station it is using. For instance, if you request:

http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/41.8497,-87.04444.json

The response contains several elements that tell you what's going on:

"station_id" - the closest station found and thus the source of the returned weather data
"display_location" - the name of the place where the station is located

Hope that helps!
Photo of santoshb

santoshb

  • 23 Posts
  • 0 Reply Likes
Thanks for your reply, though i didn't got any field "station_id" and "display_location" as any of the field.

I am accessing history data for a given longitude and latitude.

This is the URL (removed my API_KEY)
http://api.wunderground.com/api//hist...

Does history data doesn't have these field which you mentioned. Appreciate your reply.
Photo of juanbond

juanbond

  • 20 Posts
  • 8 Reply Likes
Ah yes, for history it seems to be different. Sorry, I assumed you meant conditions/forecast.

So, if you look closely at the historical data returned in your example, it contains airport station info and METAR:

...{'history'}->{'observations'}[x]->{'metar'};

"METAR KCLE 230451Z 13003KT...", with KCLE being the airport code.
Photo of santoshb

santoshb

  • 23 Posts
  • 0 Reply Likes
Thanks.
Photo of eelcokoelewijn

eelcokoelewijn

  • 2 Posts
  • 0 Reply Likes
Hourly forecast also doesn't contain a station_id or display_location! Is it possible to add these values?