rOpenGov / fmi

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

getDailyWeather fails with error when result is empty #22

Closed torsti closed 7 years ago

torsti commented 7 years ago

As the title says. I assume the desired behaviour would be to return an empty object or something else. Or at least a more useful error message. The error seems to be in convertOGR. To which package does that belong?

> client$getDailyWeather(startDateTime="2012-05-15", endDateTime="2012-07-17", fmisid = 100929)
trying URL 'http://data.fmi.fi/fmi-apikey/the-api-key/wfs?request=getFeature&storedquery_id=fmi::observations::weather::daily::timevaluepair&starttime=2012-05-15&endtime=2012-07-17&fmisid=100929&parameters=rrday,snow,tday,tmin,tmax'
Content type 'text/xml; charset=UTF-8' length 1988 bytes
==================================================
downloaded 1988 bytes

ogr2ogr -f GML  -splitlistfields /tmp/Rtmp9R6Bi7/file470e214c4ed /tmp/Rtmp9R6Bi7/file470e50047a05 PointTimeSeriesObservation
ERROR 1: Couldn't fetch requested layer 'PointTimeSeriesObservation'!
Error in convertOGR(sourceFile = private$cachedResponseFile, layer = layer,  : 
  Conversion failed.

I will try to investigate further.

torsti commented 7 years ago

convertOGR is defined in rwfs/R/utils.R, so not directly a problem for fmi.

jlehtoma commented 7 years ago

I think it would make sense to improve the error messaging. @torsti : would you like to open an issue at rwfs?

Note also that the upcoming 0.2.0 release still in the develop has quite a few things changed, most notably doing away with ogr2ogr by default.

torsti commented 7 years ago

Issue reported: rwfs/issue/12. Should we close here?

@jlehtoma Lazy me had missed the develop branch, thanks for pointing it out!

jlehtoma commented 7 years ago

@torsti no worries, lazy me haven't got around to finalize the 0.2.0 release to be merged to master. Thanks for opening up the issue, I'm closing this one.