EMODnet / EMODnetWCS

Access EMODnet Web Coverage Service data through R
https://emodnet.github.io/EMODnetWCS/
Other
6 stars 1 forks source link

Downloaded data always contains only NaN #57

Closed pepijn-devries closed 3 days ago

pepijn-devries commented 1 week ago

Running the example from the README page returns a terra SpatRaster object which contains only NaN values. This is shown by the regex below:

library(EMODnetWCS)
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...

wcs <- emdn_init_wcs_client(service = "biology")
#> ✔ WCS client created succesfully
#> ℹ Service: <https://geo.vliz.be/geoserver/Emodnetbio/wcs>
#> ℹ Service: "2.0.1"

cov <- emdn_get_coverage(wcs, 
                         coverage_id = "Emodnetbio__cal_fin_19582016_L1_err",
                         bbox = c(xmin = 0, 
                                  ymin = 40, 
                                  xmax = 5, 
                                  ymax = 45),
                         nil_values_as_na = TRUE)
#> Loading required package: sf
#> Warning: package 'sf' was built under R version 4.3.3
#> Linking to GEOS 3.11.2, GDAL 3.8.2, PROJ 9.3.1; sf_use_s2() is FALSE
#> ── Downloading coverage "Emodnetbio__cal_fin_19582016_L1_err" ──────────────────
#> No encoding supplied: defaulting to UTF-8.
#> <GMLEnvelope>
#> ....|-- lowerCorner: 40 0 "1958-02-16T01:00:00"
#> ....|-- upperCorner: 45 5 "2016-11-16T01:00:00"Start tag expected, '<' not found
#> 
#> ✔ Coverage "Emodnetbio__cal_fin_19582016_L1_err" downloaded succesfully as a
#>        terra <SpatRaster>
#> ✔ nil values 9.96920996838687e+36 converted to NA on all bands.

cov[[1]] |> terra::values() |> is.nan() |> all()
#> [1] TRUE

Created on 2024-11-04 with reprex v2.0.2

I've tried other services and layers as well with the same result. Am I doing something wrong, or is this a bug?

Pepijn

pepijn-devries commented 3 days ago

This is actually not an issue, I was looking at the wrong layer. I do have another issue for which I will open an new report