OSMscale-package: Add a Scalebar to OpenStreetMap Plots

Description Note Author(s) See Also Examples

Description

Functionality to handle and project lat-long coordinates, easily download background maps and add a correct scale bar to 'OpenStreetMap' plots in any map projection. There are some other spatially related miscellaneous functions as well.

Note

Get the most recent code updates at https://github.com/brry/OSMscale

Author(s)

Berry Boessenkool, [email protected], June 2016

See Also

scaleBar, pointsMap, projectPoints, mapmisc article at https://journal.r-project.org/archive/2016-1/brown.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 # Not tested on CRAN to avoid download time
d <- read.table(sep=",", header=TRUE, text=
"lat, long
55.685143, 12.580008
52.514464, 13.350137
50.106452, 14.419989
48.847003, 2.337213
51.505364, -0.164752")

# zoom set to 3 to speed up tests. automatic zoom determination is better.
map <- pointsMap(lat, long, data=d, type="maptoolkit-topo",
                 proj=putm(d$long), scale=FALSE, zoom=3, pch=16, col=2)
scaleBar(map, abslen=500, y=0.8, cex=0.8)
lines(projectPoints(d$lat, d$long), col="blue", lwd=2)

brry/OSMscale documentation built on April 18, 2018, 8:23 p.m.