ch_get_map_base {CSHShydRology}R Documentation

ch_get_map_base

Description

Prepares for mapping by acquiring the base map and ancillary data: boundaries and rivers. The maps are obtained using OpenStreetMap::openmap which originally accessed the following map types: "osm", "osm-bw", "maptoolkit-topo", "waze", "bing", "stamen-toner", "stamen-terrain", "stamen-watercolor", "osm-german", "osm-wanderreitkarte", "mapbox", "esri", "esri-topo", "nps", "apple-iphoto", "skobbler", "hillshade", "opencyclemap", "osm-transport", "osm-public-transport", "osm-bbike", "osm-bbike-german".

In April 2022 access all of these failed, limiting the available maps to: one of "osm", "bing", "stamen-toner", "stamen-terrain", "stamen-watercolor", "apple-iphoto", "opencyclemap", "osm-transport", "osm-public-transport".

In January 2023, ne_download failed as it produced an incorrect url.

Access to "nps" [default] was added as a work around until OpenstreetMap is updated.

"nps": This layer presents the U.S. National Park Service (NPS) Natural Earth physical map at 1.24km per pixel for the world and 500m for the coterminous United States.

Usage

ch_get_map_base(
  maplat,
  maplong,
  map_proj = NA,
  map_directory = ".",
  map_type = "nps"
)

Arguments

maplat

vector of latitudes (2)

maplong

vector of longitudes (2)

map_proj

map projection currently NA/"latlong" or "albers"/"equalarea"

map_directory

directory where map data will be stored; will be created if it does not exist.

map_type

map type: select one of osm, bing, stamen-toner, stamen-terrain, stamen-watercolor, apple-iphoto, opencyclemap, osm-transport, osm-public-transport, nps [default],

Value

Returns a list containing:

map_d

map data directory

plines10

provincial and state boundaries

rlines10

rivers and lakes

map_proj

projection used

latitude

bottom and top latitudes

longitude

east and west longitudes

Author(s)

Paul Whitfield

Examples


# Note: example not tested automatically as it is very slow to execute due to the downloading
latitude <- c(48.0,  61.0)
longitude <- c(-110.0, -128.5)
mapdir <- tempdir()
# get map data
m_map <- ch_get_map_base(latitude,longitude, 
                     map_proj = "Albers", 
                     map_directory = mapdir, 
                     map_type = "nps")
                      

[Package CSHShydRology version 1.4.0 Index]