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 with a layer of chemistry_marine_litter #165

Open
maelle opened this issue Mar 21, 2024 · 7 comments
Open

Bug with a layer of chemistry_marine_litter #165

maelle opened this issue Mar 21, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@maelle
Copy link
Collaborator

maelle commented Mar 21, 2024

The comment " Failed to parse QName 'ms:'" actually appears thousands of times.

library("EMODnetWFS")
service <- "chemistry_marine_litter"
layers_info <- emodnet_get_wfs_info(service = service)
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> ✔ WFS client created successfully
#> ℹ Service: "https://www.ifremer.fr/services/wfs/emodnet_chemistry2"
#> ℹ Version: "2.0.0"
layer <- layers_info[layers_info[["format"]] == "sf",][1,][["layer_name"]]

layer
#> [1] "bl_beacheslocations_monitoring"

emodnet_get_layers(service = service, layers = layer)[[1]] |>
    sf::st_crs() |>
    print()
#> ✔ WFS client created successfully
#> ℹ Service: "https://www.ifremer.fr/services/wfs/emodnet_chemistry2"
#> ℹ Version: "2.0.0"
#> Failed to parse QName 'ms:'
#> Failed to parse QName 'ms:'
#> Coordinate Reference System:
#>   User input: WGS 84 
#>   wkt:
#> GEOGCRS["WGS 84",
#>     DATUM["World Geodetic System 1984",
#>         ELLIPSOID["WGS 84",6378137,298.257223563,
#>             LENGTHUNIT["metre",1]]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433]],
#>     CS[ellipsoidal,2],
#>         AXIS["geodetic latitude (Lat)",north,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         AXIS["geodetic longitude (Lon)",east,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["World"],
#>         BBOX[-90,-180,90,180]],
#>     ID["EPSG",4326]]

Created on 2024-03-21 with reprex v2.1.0

@maelle maelle added the bug Something isn't working label Mar 21, 2024
@maelle
Copy link
Collaborator Author

maelle commented Mar 21, 2024

The same code run with "suppressXMLNamespaceWarning" generates no warning. It means the "ms:" namespace isn't defined.

From the docs of the XML package,

This is used to control the situation when
an XML node or attribute is created with a name space prefix that currently has
no definition for that node. This is not necessarily an error but can lead to one.

library("EMODnetWFS")
service <- "chemistry_marine_litter"
layers_info <- emodnet_get_wfs_info(service = service)
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> ✔ WFS client created successfully
#> ℹ Service: "https://www.ifremer.fr/services/wfs/emodnet_chemistry2"
#> ℹ Version: "2.0.0"
layer <- layers_info[layers_info[["format"]] == "sf",][2,][["layer_name"]]

layer
#> [1] "bl_temporalcoverage_numbersurveys_monitoring"

withr::local_options("suppressXMLNamespaceWarning" = TRUE)

emodnet_get_layers(service = service, layers = layer)[[1]] |>
    sf::st_crs() |>
    print()
#> ✔ WFS client created successfully
#> ℹ Service: "https://www.ifremer.fr/services/wfs/emodnet_chemistry2"
#> ℹ Version: "2.0.0"
#> Coordinate Reference System:
#>   User input: WGS 84 
#>   wkt:
#> GEOGCRS["WGS 84",
#>     DATUM["World Geodetic System 1984",
#>         ELLIPSOID["WGS 84",6378137,298.257223563,
#>             LENGTHUNIT["metre",1]]],
#>     PRIMEM["Greenwich",0,
#>         ANGLEUNIT["degree",0.0174532925199433]],
#>     CS[ellipsoidal,2],
#>         AXIS["geodetic latitude (Lat)",north,
#>             ORDER[1],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>         AXIS["geodetic longitude (Lon)",east,
#>             ORDER[2],
#>             ANGLEUNIT["degree",0.0174532925199433]],
#>     USAGE[
#>         SCOPE["unknown"],
#>         AREA["World"],
#>         BBOX[-90,-180,90,180]],
#>     ID["EPSG",4326]]

Created on 2024-03-21 with reprex v2.1.0

@maelle
Copy link
Collaborator Author

maelle commented Mar 21, 2024

@salvafern have you encountered this before? Should we contact the maintainers of that service?

@maelle
Copy link
Collaborator Author

maelle commented Mar 28, 2024

@salvafern friendly reminder 😸 (note, I do not know who maintains the service)

@maelle maelle added this to the rOpenSci submission milestone Mar 28, 2024
@maelle
Copy link
Collaborator Author

maelle commented Apr 16, 2024

maybe use the workaround in the meantime

@maelle
Copy link
Collaborator Author

maelle commented Apr 22, 2024

now the workaround does not work anymore?! 😭

@maelle
Copy link
Collaborator Author

maelle commented Apr 22, 2024

it'd make more sense to ask the service maintainers.

@maelle
Copy link
Collaborator Author

maelle commented Apr 22, 2024

I'll come back to this another time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant