rosm: Plot Raster Map Tiles From Open Street Map and Other Sources

Description Author(s) References Examples

Description

This package provides access and plots Open Street Map and Bing Maps tiles to create high-resolution basemaps and use hillshade tiles to add texture to other maps. Uses the 'sp' package to plot using base graphics. Plot Open Street Map derivative tiles using osm.plot, and plot Bing maps (Aerial, Labeled Aerial, Road) using bmaps.plot. 16 OSM and 3 Bing sources are included, with the ability to define custom tile sources based on OSM tilex, tiley, and zoom. Use osm.raster to get tiles in a RasterStack or write to disk (requires the 'raster' package.)

Author(s)

Dewey Dunnington <dewey@fishandwhistle.net>

References

Open Street Map tile servers, Bing Maps API documentation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 library(prettymapr)

 # basic ploting
 nsbox <- searchbbox("nova scotia")
 osm.plot(nsbox)
 osm.plot(nsbox, type="stamenbw")
 bmaps.plot(nsbox)
 bmaps.plot(nsbox, type="Road")

 # use prettymapr to add scalebar and north arrow
 prettymap(osm.plot(nsbox))
 prettymap(bmaps.plot(nsbox, type="Road"))

 # define custom tile types in several ways

 # using string formats
 ts <- as.tile_source("http://a.basemaps.cartocdn.com/dark_all/${z}/${x}/${y}.png")
 osm.plot(nsbox, type=ts)

 # using string formats and register_tile_source
 register_tile_source(dark = "http://a.basemaps.cartocdn.com/dark_all/${z}/${x}/${y}.png")
 osm.plot(nsbox, type="dark")

 # set default plot type to something other than 'osm'
 set_default_tile_source("stamenbw")
 osm.plot(nsbox)

 

paleolimbot/rosm documentation built on July 23, 2019, 7:35 a.m.