print_osm_map: print_osm_map

print_osm_mapR Documentation

Description

Prints an OSM map produced with osmplotr to a specified graphics device.

Usage

print_osm_map(
  map,
  width,
  height,
  filename,
  device,
  units = c("in", "cm", "mm", "px"),
  dpi = 300
)

Arguments

map

The map to be printed; a ggplot2 object produced by osmplotr.

width

Desired width of graphics device.

height

Desired height of graphics device. Ignored if width specified.

filename

Name of file to which map is to be printed.

device

Type of graphics device (extracted from filename extension if not explicitly provided).

units

Units for height and width of graphics device.

dpi

Resolution of graphics device (dots-per-inch).

See Also

osm_basemap, add_osm_objects, make_osm_map.

Other construction: add_osm_objects(), make_osm_map(), osm_basemap(), osm_structures()

Examples

bbox <- get_bbox (c (-0.13, 51.5, -0.11, 51.52))
map <- osm_basemap (bbox = bbox, bg = "gray20")
map <- add_osm_objects (map, london$dat_BNR, col = "gray40")
print_osm_map (map, width = 7) # prints to screen device
## Not run: 
print_osm_map (map, file = "map.png", width = 500, units = "px")

## End(Not run)

mpadge/osmplotr documentation built on Oct. 28, 2024, 11:45 a.m.