Learn R Programming

osmplotr (version 0.2.0)

plot_osm_basemap: plot_osm_basemap

Description

Generates a base OSM plot ready for polygon, line, and point objects to be overlain with add_osm_objects().

Usage

plot_osm_basemap(bbox, structures, bg = "gray20")

Arguments

bbox
bounding box (Latitude-longitude range) to be plotted. A 2-by-2 matrix of 4 elements with columns of min and max values, and rows of x and y values.
structures
Data frame returned by osm_structures() used here to specify background colour of plot; if missing, the colour is specified by 'bg'
bg
Background colour of map (default = 'gray20' only if structs not given)

Value

  • ggplot object containing base map

See Also

add_osm_objects, make_osm_map.

Examples

Run this code
bbox <- get_bbox (c (-0.13, 51.5, -0.11, 51.52))
map <- plot_osm_basemap (bbox=bbox, bg='gray20')
map <- add_osm_objects (map, london$dat_BNR, col='gray40') 
print (map)

Run the code above in your browser using DataLab