Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting in WFSClient$getLayer or deal with empty / missing layers in some other fashion #12

Open
torsti opened this issue Nov 28, 2016 · 0 comments
Assignees
Milestone

Comments

@torsti
Copy link

torsti commented Nov 28, 2016

For original context see fmi/issues/22.

When trying to download weather data from FMI for a period or station where they don't exist, the FMIWFSClient$getDailyWeather get fails with an error in convertOGR. It would be preferable to have more descriptive error message or an empty dataset to be returned. The relevant rwfs code is in the WFSClient$getLayer method.

> client$getDailyWeather(startDateTime="2012-05-15", endDateTime="2012-07-17", fmisid = 100929)
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.

On the rwfs develop branch the error is still not very informative.

Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv,  : 
  Cannot open layer
Error in private$.getLayer(dataSource = sourceFile, layer = layer, crs = crs,  : 
  Fatal error.

A shortened version of the empty response:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection
    timeStamp="2016-11-28T10:54:03Z"
    numberMatched="0"
    numberReturned="0"
           xmlns:wfs="...">
   
</wfs:FeatureCollection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants