EMODnet / EMODnetWCS

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

Coverage CRS and coverage extent is not always correct #58

Open pepijn-devries opened 2 weeks ago

pepijn-devries commented 2 weeks ago

The code below fails with the current version of EMODnetWCS on github:

wcs <- emdn_init_wcs_client(service = "human_activities")

cov <- emdn_get_coverage(wcs,
                         # pseudomercator (EPSG 3857) in this case:
                         bbox = c(xmin = 484177.9, ymin = 6957617.3,
                                  xmax = 1035747, ymax = 7308616.2),
                         coverage_id = "emodnet__vesseldensity_all",
                         nil_values_as_na = FALSE)

It fails because it does not pick up the correct CRS for the map coverage. In this case it should be pseudomercator (EPSG 3857), yet it defaults to EPSG 4326. Furthermore, the extent reported by EMODnet for this map seems incorrect.

I have a pull request to fix this (will send in a minute). It will apply the correct CRS to handle the first issue. Furthermore, it provides the option to skip the coverage check. When skipping this check the code above works as expected.

pepijn-devries commented 2 weeks ago

See https://github.com/EMODnet/EMODnetWCS/pull/59