| pointsMap {OSMscale} | R Documentation | 
Get map for lat-long points
Description
Download and plot map with the extend of a dataset with lat-long coordinates.
Usage
pointsMap(
  lat,
  long,
  data,
  ext = 0.07,
  fx = 0.05,
  fy = fx,
  type = "osm",
  zoom = NULL,
  minNumTiles = 9L,
  mergeTiles = TRUE,
  map = NULL,
  proj = NA,
  plot = TRUE,
  mar = c(0, 0, 0, 0),
  add = FALSE,
  scale = TRUE,
  quiet = FALSE,
  pch = 3,
  col = "red",
  cex = 1,
  bg = NA,
  pargs = NULL,
  titleargs = NULL,
  ...
)
Arguments
lat, long | 
 Latitude (North/South) and longitude (East/West) coordinates in decimal degrees  | 
data | 
 Optional: data.frame with the columns   | 
ext | 
 Extension added in each direction if a single coordinate is given. DEFAULT: 0.07  | 
fx, fy | 
 Extend factors (additional map space around actual points)
passed to custom version of   | 
type | 
 Tile server in   | 
zoom, minNumTiles, mergeTiles | 
 Arguments passed to   | 
map | 
 Optional map object. If given, it is not downloaded again. Useful to project maps in a second step. DEFAULT: NULL  | 
proj | 
 If you want to reproject the map (Consumes some extra time), the
proj4 character string or CRS object to project to, e.g.   | 
plot | 
 Logical: Should map be plotted and points added? Plotting happens with
  | 
mar | 
 Margins to be set first (and left unchanged). DEFAULT: c(0,0,0,0)  | 
add | 
 Logical: add points to existing map? DEFAULT: FALSE  | 
scale | 
 Logical: should   | 
quiet | 
 Logical: suppress progress messages and non-df warning in 
  | 
pch, col, cex, bg | 
 Arguments passed to   | 
pargs | 
 List of arguments passed to   | 
titleargs | 
 List of arguments passed to   | 
... | 
 Further arguments passed to   | 
Value
Map returned by OpenStreetMap::openmap
Author(s)
Berry Boessenkool, berry-b@gmx.de, Jun 2016
See Also
projectPoints, OpenStreetMap::openmap
Examples
if(interactive()){
d <- read.table(sep=",", header=TRUE, text=
"lat, long # could e.g. be copied from googleMaps, rightclick on What's here?
43.221028, -123.382998
43.215348, -123.353804
43.227785, -123.368694
43.232649, -123.355895")
map <- pointsMap(lat, long, data=d)
axis(1, line=-2); axis(2, line=-2) # in whatever unit
map_utm <- pointsMap(lat, long, d, map=map, proj=putm(d$long))
axis(1, line=-2); axis(2, line=-2) # now in meters
projectPoints(d$lat, d$long)
scaleBar(map_utm, x=0.2, y=0.8, unit="mi", type="line", col="red", length=0.25)
pointsMap(lat, long, d[1:2,], map=map_utm, add=TRUE, col="red", pch=3, pargs=list(lwd=3))
d <- data.frame(long=c(12.95, 12.98, 13.22, 13.11), lat=c(52.40,52.52, 52.36, 52.45))
map <- pointsMap(lat,long,d, type="bing") # aerial map
}