We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › weather data
Page Index Toggle Pages: 1
weather data (Read 1012 times)
weather data
Jun 3rd, 2008, 10:47pm
 
Hello,

I'm new in Processing, and I'm reading the book of Ben Fry (Visualizing Data).

Now I'd like to make a project where the program update the Data in real time, and access on a weather data of cities arround the world.

Someone tell me where I can take this Data on the web, and update the program online??

Thanks from Catalonia (Barcelona - Spain).

Slastik
Re: weather data
Reply #1 - Jun 4th, 2008, 10:02pm
 
Hi,

First look for public meteo data on the web, I have no doubt you can find a lot : Google is your friend.

Then, depending on the file format of the data sheets you'll get, you may need a library such as proHTML (if your data is HTML formatted) or XML Import (if XML formatted) to extract the info you need.

Have fun!
Re: weather data
Reply #2 - Jun 5th, 2008, 7:41am
 
For US cities you can get weather reports from
http://weather.noaa.gov/

You can also get aviation weather reports for airports.  For example, here's the report from Sky Harbor in Phoenix:
http://weather.noaa.gov/pub/data/forecasts/taf/stations/KPHX.TXT

-B
Re: weather data
Reply #3 - Jun 6th, 2008, 11:26am
 
An article (on PHP, but the data is there) points to Yahoo! weather data: Using Weather Data
Re: weather data
Reply #4 - Jun 6th, 2008, 11:52am
 
very nice link. here's an example on how to do it in Processing :

Code:
import processing.xml.*;
String urlParis = "http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c";
XMLElement report = new XMLElement(this, urlParis);
println(report.getChild("channel").getChild("item").getChild("yweather:condition").getIntAttribute("temp") + "°C in Paris today");


how to get a city code is explained here:
http://developer.yahoo.com/weather/

Quote:
The location parameter can be a US Zip code or a location ID. To find your location ID, browse or search for your city from the Yahoo! Weather home page. The weather ID is in the URL for the forecast page for that city. You can also get the location ID by entering your zip code on the home page. For example, if you search for Los Angeles on the Yahoo! Weather home page, the forecast page for that city is http://weather.yahoo.com/forecast/USCA0638.html. The location ID is USCA0638.
Page Index Toggle Pages: 1