diff --git a/R/get_maptypes.R b/R/get_maptypes.R index 7ab89f5..17e6ed6 100644 --- a/R/get_maptypes.R +++ b/R/get_maptypes.R @@ -20,6 +20,8 @@ #' #' \code{"esri"}: Esri (\url{https://www.esri.com/en-us/home}) #' +#' \code{"usgs"}: USGS (\url{https://basemap.nationalmap.gov/arcgis/rest/services}) +#' #' @examples #' # for all services #' get_maptypes() diff --git a/R/internal.R b/R/internal.R index e05f057..dd31b7d 100644 --- a/R/internal.R +++ b/R/internal.R @@ -169,8 +169,8 @@ out <- function(input, type = 1, ll = NULL, msg = FALSE, sign = "", verbose = ge # download tiles url <- paste0( getOption("basemaps.map_api")[[map_service]][[map_type]], tg$zoom, "/", # base URL - if(map_service == "esri") paste0(x[2], "/", x[1]) else paste0(x[1], "/", x[2]), # coordinate order - if(any(map_service != "mapbox", all(map_service == "mapbox", map_type == "terrain"))) ".png", # file suffix or not + if(map_service %in% list("esri", "usgs")) paste0(x[2], "/", x[1]) else paste0(x[1], "/", x[2]), # coordinate order + if(any(!(map_service %in% list("mapbox", "usgs")), all(map_service == "mapbox", map_type == "terrain"))) ".png", # file suffix or not if(map_service == "mapbox") paste0("?access_token=", map_token), # token or not if(map_service == "osm_thunderforest") paste0("?apikey=", map_token) # token or not ) @@ -501,7 +501,15 @@ out <- function(input, type = 1, ll = NULL, msg = FALSE, sign = "", verbose = ge world_reference_overlay = "https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/", world_transportation = "https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/", delorme_world_base_map = "https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/", - world_navigation_charts = "https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/") + world_navigation_charts = "https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/" + ), + usgs = list( + hydro_cached = "https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/tile/", + imagery_only = "https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/", + imagery_topo = "https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/", + shaded_relief = "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/tile/", + topo = "https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/" + ) )) if(!dir.exists(getOption("basemaps.defaults")$map_dir)) dir.create(getOption("basemaps.defaults")$map_dir) diff --git a/README.md b/README.md index 2e08181..d3ee0c3 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,11 @@ This table lists all currently implemented map services and map types and indica | `esri` | `world_transportation` | no | | `esri` | `delorme_world_base_map` | no | | `esri` | `world_navigation_charts` | no | +| `usgs` | `hydro_cached` (max zoom: 16) | no | +| `usgs` | `imagery_only` (max zoom: 16) | no | +| `usgs` | `imagery_topo` (max zoom: 16) | no | +| `usgs` | `shaded_relief` (max zoom: 16) | no | +| `usgs` | `topo` (max zoom: 16) | no | ## Available functions