Learn R Programming

ggmap (version 2.2)

get_cloudmademap: Get a CloudMade map

Description

get_cloudmademap accesses a tile server for Stamen Maps and downloads/stiches map tiles/formats a map image.

Usage

get_cloudmademap(bbox = c(left = -95.80204, bottom = 29.38048, right = -94.92313, top = 30.14344),
    zoom = 10, api_key, maptype = 1, highres = TRUE,
    crop = TRUE, messaging = FALSE, urlonly = FALSE,
    filename = "ggmapTemp", color = c("color", "bw"), ...)

Arguments

bbox
a bounding box in the format c(lowerleftlon, lowerleftlat, upperrightlon, upperrightlat).
zoom
a zoom level
api_key
character string containing cloud made api key, see details
maptype
an integer of what cloud made calls style, see details
highres
double resolution
crop
crop raw map tiles to specified bounding box
messaging
turn messaging on/off
urlonly
return url only
filename
destination file for download (file extension added according to format)
color
color or black-and-white
...
...

Value

  • a map image as a 2d-array of colors as hexadecimal strings representing pixel fill values.

Details

accesses cloud made maps. this function requires an api which can be obtained for free from http://cloudmade.com/user/show. thousands of maptypes ("styles"), including create-your-own options, are available from http://maps.cloudmade.com/editor

See Also

http://maps.cloudmade.com/, ggmap

Examples

Run this code
# in what follows, enter your own api key
api_key <- '<your api key here>'

map <- get_cloudmademap(api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 997, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 31643, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 31408, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 15434, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 9203, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 53428, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 15153, api_key = api_key)
ggmap(map)

map <- get_cloudmademap(maptype = 7877, api_key = api_key)
ggmap(map)

Run the code above in your browser using DataLab