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

Add USGS tileset options #23

Open FishheadNate opened 11 months ago

FishheadNate commented 11 months ago

Expand map_service and map_type options to include U.S. Geological Survey (USGS) tilesets:

16EAGLE commented 6 months ago

Thank you for taking the time to add this tile service! Would be nice to have this in the package.

When testing this with the default ext object of basemaps, I am getting 404 errors. Is there a limitation on the zoom level for these tile servers?

library(basemaps)
data(ext)

set_defaults(map_service = "usgs", map_type = "imagery_topo")
basemap_ggplot(ext)
#> Loading basemap 'imagery_topo' from map service 'usgs'...
#>  |                                                                                                     | 0 % ~calculating  
#> Error: Tile download failed: HTTP error 404.

Also, when I check the start tile and end tile links at https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer, I get 404 errors starting with Level 9.

Any ideas?