-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enable passing Vendor parameters to ows4R::GetFeature() #88
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea! Added a few comments.
ews_get_layer(x, wfs = wfs, cql_filter = y, | ||
suppress_warnings = suppress_warnings, ...) | ||
}, | ||
wfs, suppress_warnings, ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the dots passed here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
purrr::map does funny stuff with dots so this was the only way to get it to work: https://stackoverflow.com/questions/48215325/passing-ellipsis-arguments-to-map-function-purrr-package-r
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this as code comment so we don't forget? That sounds good to know 😅
@@ -0,0 +1,11 @@ | |||
test_that("vendor param count works", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are there new fixtures, and what is their size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I'm testing a new request. Small because it only returns the first feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there is no httptest::with_mock_dir in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yesh. Actually it doesn't seem like there is fixture for it but there probably should be
Co-authored-by: Maëlle Salmon <maelle.salmon@yahoo.se>
By requesting test_emodnetwfs <- emodnet_get_layers(
wfs_client,
layers = "eurobis-obisenv_full",
viewParams = viewparams,
resultType = "results"
)
class(test_emodnetwfs$`eurobis-obisenv_full`)
#> [1] "sf" "data.frame" I agree that WFS is meant to share vector data, so the layers should have a geometry. But there will be cases in which there is no geometry and it would be good to check it as in eblondel/ows4R#65 (comment) (and maybe raise a warning?). I will check why the basic data don't have geometry. If there is not a serious reason I will add the geom via geoserver (the layer has anyways lon and lat as attributes) Feel free to merge 🎉 |
This PR (I believe) addresses the issues raised in #86 by introducing dots into emodnet_get_layers() which allows passing additional vendor parameters etc. to underlying ows4R::GetFeature() function.
I've started fresh because of merge issues with previous PR #87
This allows, for example, passing a count=1 argument to return just the first feature.
I've now tested this and it works at least with the simple
count = 1
request.@salvafern I tried your example and I'm now getting a different error which has to do with the result being a data.frame:
This is an issue identified in #62 but your input on what @maelle has been thinking as a solution would be useful. Ultimately, WFS is not really the place to serve non spatial data but it seems there are some such datasets so we'll need a strategy to handle them.
Moved vignettes to articles.
I've also gone ahead and moved our docs from vignettes to articles so they don't get rebuilt every time R CMD CHECK is run