Weather station in database

  • Ads

Weather station in database

Postby spongebob » Fri Jan 08, 2010 9:01 am

Hi,

I was wondering if it's possible to include the international weather station code for an IP location in the database (or use another table for this) ?
The idea is to avoid doing query to get, for example, Paris' weather station code each time I want to get the weather for the IP.

Currently, I can loop through all the records and generate this data myself but it would be nice if it was saved in the original DB.
Best regards
spongebob
 
Posts: 2
Joined: Fri Jan 08, 2010 8:55 am

Re: Weather station in database

Postby marchost » Sat Jan 09, 2010 11:21 am

Hi, yes I think it would be possible...

I would simply need a weather station database with lat/long. I could calculate the closest station for each location.

Marc
marchost
Site Admin
 
Posts: 374
Joined: Wed Apr 08, 2009 9:55 pm

Re: Weather station in database

Postby spongebob » Mon Jan 11, 2010 8:17 am

I've got some solutions for you:
1) Using the weather.com, for each city + state (or country), query http://xoap.weather.com/search/search?where=CITY,STATE_OR_COUNTRY => XML answer with int'l weather code, but you can have dupes for similar names.
2) Using flickr/yahoo: http://api.flickr.com/services/rest/?method=flickr.places.findByLatLon&api_key=...&lat=LATITUDE&lon=LONGITUDE&api_sig=...
You'll get an XML answer, with and where on earth ID (WOEID), then query yahoo on http://weather.yahooapis.com/forecastrss?w=WOEID you'll get a RSS answer with the international code in the <guid> node.
3) Using geonames: http://ws.geonames.org/findNearByWeatherXML?lat=LATITUDE&lng=LONGITUDE => you'll get a weather station code, but it's only airport weather station code, so it's less precise
4) Using google, but I don't understand how their reverse geocoding api works.

This is a bunch of requests to make, but, at least you'll get something very precise. Using XPath it's a matter of writing the right rule (I've done this already, so please PM me, I could share with you), and then, it's a batch script to run.

At least a city based precision would be a great, great step forward.
spongebob
 
Posts: 2
Joined: Fri Jan 08, 2010 8:55 am

Re: Weather station in database

Postby marchost » Wed Jan 13, 2010 4:58 pm

Great thanks for the info... I will work on that but it might not appear until march release.

Marc
marchost
Site Admin
 
Posts: 374
Joined: Wed Apr 08, 2009 9:55 pm

Re: Weather station in database

Postby what » Sat Jun 19, 2010 5:57 pm

Hey marc,

Came across this thread while searching for something else. I'm not sure if you actually wanted to add weather stations to your database, but the codes spongebob is referring to are location ids for weather.com's api. I'm not sure they actually refer to weather stations (they're not the station ids that the WMO uses, anyways) and if IIRC they simulate the weather with some fancy software for a lot of places. But I have seen paid ip2loc apis that include them in the response, maybe if you ask nicely weather.com will give them to you and you can map them to locations in our database. Or you can get a list of IATA and ICAO codes (and their locations) from NOAA http://aviationweather.gov/adds/metars/stations.txt

spongebob, you may want to consider using worldweatheronline.com They have a free api that you can query by lat/lon, which would save you the extra request or the trouble of maintaining your own database of weather.com location ids.
what
 
Posts: 3
Joined: Sat Jun 19, 2010 3:23 pm

Re: Weather station in database

Postby marchost » Thu Jun 24, 2010 1:40 pm

Hi, finally I dropped the weather station idea because I dont think it would be useful to the majority of people...
marchost
Site Admin
 
Posts: 374
Joined: Wed Apr 08, 2009 9:55 pm


Return to IP geolocation API related



Who is online

Users browsing this forum: No registered users and 1 guest