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

Bug human_activities + majorcatches #49

Closed
maelle opened this issue Mar 2, 2022 · 5 comments
Closed

Bug human_activities + majorcatches #49

maelle opened this issue Mar 2, 2022 · 5 comments

Comments

@maelle
Copy link
Collaborator

maelle commented Mar 2, 2022

library("EMODnetWFS")
wfs <- emodnet_init_wfs_client(service = "human_activities")
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://ows.emodnet-humanactivities.eu/wfs'
#> ℹ Version: '2.0.0'

   or_filter_sf <- emodnet_get_layers(
        wfs = wfs,
        layers = "majorcatches",
        cql_filter = "country='Baltic Sea' OR country='Bulgaria'",
        reduce_layers = TRUE
    )
#> Warning: Download of layer 'majorcatches' failed: Error: Cannot open "/tmp/RtmpZxxHz3/file630649c69027.gml"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.

Created on 2022-03-02 by the reprex package (v2.0.1)

@maelle
Copy link
Collaborator Author

maelle commented Mar 2, 2022

library("EMODnetWFS")
wfs <- emodnet_init_wfs_client(service = "bathymetry")
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://ows.emodnet-bathymetry.eu/wfs'
#> ℹ Version: '2.0.0'

simple_filter_sf <- emodnet_get_layers(
    wfs = wfs,
    layers = "contours",
    cql_filter = "country='Baltic Sea'",
    reduce_layers = TRUE
)
#> Warning: Download of layer 'contours' failed: Error: Cannot open "/tmp/RtmpjsPInd/file866b45f8156c.gml"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.

Created on 2022-03-02 by the reprex package (v2.0.1)

@maelle
Copy link
Collaborator Author

maelle commented Mar 2, 2022

@annakrystalli Could you try to run the two reprexes above and see whether they fail for you too?

@maelle maelle mentioned this issue Mar 2, 2022
@annakrystalli
Copy link
Collaborator

That's because the country attribute doesn't exist in those layers:

library("EMODnetWFS")
wfs <- emodnet_init_wfs_client(service = "human_activities")
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://ows.emodnet-humanactivities.eu/wfs'
#> ℹ Version: '2.0.0'


   or_filter_sf <- emodnet_get_layers(
        wfs = wfs,
        layers = "majorcatches",
        cql_filter = "country='Baltic Sea' OR country='Bulgaria'",
        reduce_layers = TRUE
    )
#> Warning: Download of layer 'majorcatches' failed: Error: Cannot open "/private/var/folders/8p/87cqdx2s34vfvcgh04l6z72w0000gn/T/RtmpGQ0igj/filede191b171af0.gml"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.

   


any("country" %in% layer_attributes_get_names(wfs, layer = "majorcatches"))
#> [1] FALSE
any("country" %in% layer_attributes_get_names(service = "bathymetry", layer = "contours"))
#> ✓ WFS client created succesfully
#> ℹ Service: 'https://ows.emodnet-bathymetry.eu/wfs'
#> ℹ Version: '2.0.0'
#> [1] FALSE

Created on 2022-03-02 by the reprex package (v2.0.1)

@annakrystalli
Copy link
Collaborator

The handling of these filtering messages definitely need improving

@maelle
Copy link
Collaborator Author

maelle commented Mar 2, 2022

Ok then this should be tackled by #54 :-)

@maelle maelle closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants