Skip to content

Conversation

@FishheadNate
Copy link

@FishheadNate FishheadNate commented Sep 25, 2023

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

  • USGS Hydro Cached

    basemap_ggplot(ext, map_service = "usgs", map_type = "hydro_cached") + theme_void()
  • USGS Imagery Only

    basemap_magick(ext, map_service = "usgs", map_type = "imagery_only")
  • USGS Imagery Topo

    basemap_magick(ext, map_service = "usgs", map_type = "imagery_topo")
  • USGS Shaded Relief Only

    basemap_magick(ext, map_service = "usgs", map_type = "shaded_relief")
  • USGS Topo

    basemap_magick(ext, map_service = "usgs", map_type = "topo")

@FishheadNate FishheadNate deleted the nate/add-custom-tileset-option branch September 25, 2023 19:05
@FishheadNate FishheadNate changed the title print tile URL Add USGS tileset options Sep 26, 2023
@FishheadNate FishheadNate reopened this Sep 26, 2023
@16EAGLE
Copy link
Owner

16EAGLE commented Mar 3, 2024

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?

@markbidwell
Copy link

markbidwell commented Nov 13, 2024

Hi Jakob - could that error be caused by the default ext object being in Europe, while the map tiles are for the USA?

@FishheadNate
Copy link
Author

I'll look into adding some parameters to limit the extent and zoom of the layers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants