Downloads a Stamen Maps or Google Maps base layer map using get_map.
download_basemap( x, verbose = TRUE, zoom, alpha = 1, source = "stamen", maptype = "terrain", ... )
x | An object of class |
---|---|
verbose | Logical, whether to print information to console. |
zoom | Zoom level (optional), see get_map. An integer from 3 (continent) to 21 (building). By default the zoom level matching the ppi extent is selected automatically. |
alpha | Transparency of the basemap (0-1). |
source | String identifying which map service should be used: "stamen" or "google". |
maptype | Type of basemap to plot. For Stamen Maps: "terrain", "terrain-background", "terrain-labels", "terrain-lines", "toner", "toner-2010", "toner-2011", "toner-background", "toner-hybrid", "toner-labels", "toner-lines", "toner-lite", "watercolor". For Google Maps: "terrain", "satellite", "roadmap", "hybrid" |
... | Arguments to pass to get_map function. |
To use Google Maps as source
, you will have to register with Google,
enable billing and provide an API key to ggmap. See the ggmap
README for details.
To use maptype
, install the development version of ggmap (>3.0.0) with
devtools::install_github("dkahle/ggmap")
.
#> Polar scan (class scan) #> #> parameters: VRADH DBZH ZDR RHOHV PHIDP #> elevation angle: 0.5 deg #> dims: 480 bins x 360 rays# make ppi for the scan ppi <- project_as_ppi(example_scan) if (FALSE) { # grab a basemap that matches the extent of the ppi: basemap <- download_basemap(ppi) # map the reflectivity quantity of the ppi onto the basemap: map(ppi, map = basemap, param = "DBZH") # increase the transparancy of the basemap: basemap <- download_basemap(ppi, alpha = 0.3) map(ppi, map = basemap, param = "DBZH") # download a different type of basemap, e.g. a gray-scale image: # see get_map() in ggmap library for full documentation of options basemap <- download_basemap(ppi, maptype = "toner-lite") # map the radial velocities onto the line image: map(ppi, map = basemap, param = "VRADH") }