16EAGLE / basemaps

A lightweight package for accessing basemaps from open sources in R 🗺️
https://jakob.schwalb-willmann.de/basemaps
GNU General Public License v3.0
57 stars 15 forks source link

Calling ESRI world_ocean_reference in ggplot gives error #9

Closed bltern closed 2 years ago

bltern commented 2 years ago

If you call basemap_gglayer(ext = ext, map_service = "esri", map_type = "world_ocean_reference", map_res = NULL,map_token = NULL, map_dir = NULL, force = NULL) or basemap_ggplot, an erorr is thrown:

"Error in grDevices::rgb(red = df$val1, green = df$val2, blue = df$val3, : color intensity NA, not in 0:255"

This does not happen with the "world_ocean_base" basemap which renders just fine.

I am using the latest version 0.0.3. Thanks. This is a great package that is very useful.

16EAGLE commented 2 years ago

Thanks. To generally address this, I added a handling to account for cases in which maps returned by tile servers (for whatever reasons) consist of only a single value (e.g. 0) for the given query extent. Instead of failing with the above error, empty maps returned by tile servers are handed over gracefully now.