Open maelle opened 5 months ago
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
@salvafern have you encountered this before? Should we contact the maintainers of that service?
@salvafern friendly reminder :smile_cat: (note, I do not know who maintains the service)
maybe use the workaround in the meantime
now the workaround does not work anymore?! :sob:
it'd make more sense to ask the service maintainers.
I'll come back to this another time.
@salvafern do you think we could/should ask the service maintainers? it's weird it does not come up for other services.
even using withr::local_options("suppressXMLNamespaceWarning" = TRUE)
does not suppress the warning.
I just saw the error in the example you provided here. I will check who is the maintainer
ms:
is a standard/default prefix for MapServer
https://github.com/MapServer/MapServer/issues/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
Ok, let's leave this aside for now. Thank you!
I'm surprised that my workaround from earlier (suppressing the warning) no longer works.
The comment " Failed to parse QName 'ms:'" actually appears thousands of times.
Created on 2024-03-21 with reprex v2.1.0