Learn R Programming

osmplotr (version 0.1-1)

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(). NOTE: Graphics files must be closed after finishing map with dev.off() or graphics.off(). Unless specified, height of graphics device is automatically calculated in proportion to the given width according to the aspect ratio of the bounding box.

Usage

plot_osm_basemap(xylims = xylims, filename = NULL, width = 640,
  structures = NULL, bg = "gray20", graphic.device = "png", ...)

Arguments

xylims
Latitude-longitude range to be plotted as returned from get_xylims()
filename
Name of plot file; default=NULL plots to screen device (low quality and likely slow)
width
Width of graphics file (in px; default 480).
structures
Data frame returned by osm_structures() used here to specify background colour of plot; if 'structs=NULL', the colour is specified by 'bg'
bg
Background colour of map (default = 'gray20' only if structs not given)
graphic.device
Type of graphic device to print to. For example, 'png' (default), 'jpeg', 'png', or 'tiff'
...
Other parameters to be passed to graphic device (such as width and height; see ?png, for example, for details)

Value

  • nothing (generates file of specified type)