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 · 12 comments
Open

Bug with a layer of chemistry_marine_litter #165

maelle opened this issue Mar 21, 2024 · 12 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.

@maelle
Copy link
Collaborator Author

maelle commented Aug 12, 2024

@salvafern do you think we could/should ask the service maintainers? it's weird it does not come up for other services.

@maelle
Copy link
Collaborator Author

maelle commented Aug 12, 2024

even using withr::local_options("suppressXMLNamespaceWarning" = TRUE) does not suppress the warning.

@salvafern
Copy link
Collaborator

I just saw the error in the example you provided here. I will check who is the maintainer

@bart-v
Copy link

bart-v commented Aug 12, 2024

ms: is a standard/default prefix for MapServer
MapServer/MapServer#1461

So, the WFS validator should be able to deal with this.
Just like many other libraries which took that into account years ago, already...
http://lists.maptools.org/pipermail/chameleon-dev/2006-December/004690.html
https://gis.stackexchange.com/questions/75756/openlayers-and-wfs-using-a-mapfile-correctly-with-featuretype-and-featurens

@maelle
Copy link
Collaborator Author

maelle commented Aug 12, 2024

Ok, let's leave this aside for now. Thank you!

I'm surprised that my workaround from earlier (suppressing the warning) no longer works.

@maelle maelle added bug Something isn't working and removed bug Something isn't working labels Aug 23, 2024
@maelle maelle removed this from the rOpenSci submission milestone Aug 23, 2024
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

3 participants