Learn R Programming

osmplotr (version 0.2.0)

osm_structures: osm_structures

Description

For the given vector of structure types returns a 'data.frame' containing two columns of corresponding OpenStreetMap key-value pairs, one column of unambiguous suffices to be appended to the objects returned by get_osm_data(), and one column specifying colours. This data frame may be subsequently modified as desired, and ultimately passed to make_osm_map() to automate map production.

Usage

osm_structures(structures = c("building", "amenity", "waterway", "grass",
  "natural", "park", "highway", "boundary", "tree"), col_scheme = "dark")

Arguments

structures
The vector of types of structures (defaults listed in '?extract_osm_objects').
col_scheme
Colour scheme for the plot (current options include 'dark' and 'light')

Value

  • 'data.frame' of structures, key-value pairs, corresponding prefixes, and colours.

See Also

make_osm_map.

Examples

Run this code
# Default structures:
osm_structures ()
# user-defined structures:
structures <- c ('highway', 'park', 'grass')
structs <- osm_structures (structures=structures, col_scheme='light')
# make_osm_map returns potentially modified list of data
dat <- make_osm_map (osm_data=london, structures=structs)
# map contains updated $osm_data and actual map in $map
print (dat$map)

Run the code above in your browser using DataLab