rOpenGov / fmi

Finnish Meteorological Institute open data API R client
Other
10 stars 7 forks source link

get_weather_data() in the old blog post doesn't work #8

Closed jlehtoma closed 7 years ago

jlehtoma commented 8 years ago

Function get_weather_data() used to generate the old blog post gives the following error:

kaisa.2012 <- get_weather_data(apiKey, startDateTime, endDateTime, fmisid.kaisa)
trying URL 'http://data.fmi.fi/fmi-apikey/0253711c-056f-439b-af9d-a5a3a2920faf/wfs?request=getFeature&storedquery_id=fmi::observations::weather::daily::timevaluepair&starttime=2011-12-24&endtime=2012-12-31&fmisid=100971&parameters=rrday,snow,tday,tmin,tmax'
 Show Traceback

 Rerun with Debug
 Error in download.file(private$getURL(), destFile, "internal") : 
  cannot open URL 'http://data.fmi.fi/fmi-apikey/0253711c-056f-439b-af9d-a5a3a2920faf/wfs?request=getFeature&storedquery_id=fmi::observations::weather::daily::timevaluepair&starttime=2011-12-24&endtime=2012-12-31&fmisid=100971&parameters=rrday,snow,tday,tmin,tmax' In addition: Warning message:
In download.file(private$getURL(), destFile, "internal") :
  cannot open URL 'http://data.fmi.fi/fmi-apikey/0253711c-056f-439b-af9d-a5a3a2920faf/wfs?request=getFeature&storedquery_id=fmi::observations::weather::daily::timevaluepair&starttime=2011-12-24&endtime=2012-12-31&fmisid=100971&parameters=rrday,snow,tday,tmin,tmax': HTTP status was '400 Bad Request'

Check what's wrong.

torsti commented 8 years ago

Works for me, I can't reproduce.

Slightly off-issue, but get_weather_data() or something similar should probably be made part of the package.

jlehtoma commented 8 years ago

@torsti : did you test just the function or all the code in the blog post? Could be something funky in my parameter combination. Will come back to this later. Yes, get_weather_data() would make a useful addition to the package.

torsti commented 8 years ago

Only the bit with the function and the next code block where you use the function. Also did it for the Kaisaniemi FMISID.

jlehtoma commented 7 years ago

Works fine for as well, no idea what the previous glitch was. Closing this issue.