Description Usage Arguments Value Examples
Quickly plot CanVec data with options to change the plotting style of each.
If data does not exist in the cache it will be downloaded. Simplest usage
uses searchbbox()
to find an appropriate bounding box (e.g.
canvec.qplot(bbox=searchbbox("Wolfville NS"))
). Be careful plotting
feature-intensive layers (e.g. "road", "building") over large areas (e.g.
searchbbox("toronto, on")
). This will happily run but plotting the map
may take up to 20 minutes!
1 2 3 4 |
ntsid |
One or more NTS References as generated by |
bbox |
A bounding box describing the desired extent. If no |
layers |
A list of layers as defined in |
options |
A list object containing the options for each layer in the form
|
data |
A list object that contains the loaded Spatial* data to be plotted.
This should always be an object that was returned by |
cachedir |
Pass a specific cache directory in which files have been extracted.
Default value is that returned by |
plotdata |
TRUE if data should be plotted, FALSE if data should just be loaded. |
atscale |
One of |
stoponlargerequest |
Stop if a large (greater than 4 tiles) area is requested. Defaults to
|
epsg |
The epsg code in which to plot the data, or |
... |
A list of graphical parameters passed to the inital call to |
A list object that contains the Spatial* data that was plotted
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #simplest use using searchbbox() from {prettymapr}
library(prettymapr)
wolfville <- searchbbox("Wolfville NS", source="google")
canvec.qplot(bbox=wolfville)
canvec.qplot(bbox=wolfville, layers=c("waterbody", "forest"))
#can also plot by NTS sheet and use bbox= or xlim, ylim to zoom.
canvec.qplot(nts("21h1"), layers=c("waterbody", "forest", "contour", "river", "road"))
canvec.qplot(bbox=makebbox(45.1, -64.35, 45.05, -64.4),
layers=c("waterbody", "contour", "river", "building", "building_poly", "road"))
#method returns plot data argument so data does not need to be loaded each time.
#this will not work when changing nts sheets.
plotdata <- canvec.qplot(nts("21h1"), layers=c("waterbody", "forest", "contour", "river"))
plotdata <- canvec.qplot(bbox=makebbox(45.1, -64.35, 45.05, -64.4),
layers=c("waterbody", "contour", "river"),
data=plotdata)
#use with prettymapr::addscalebar() and prettymapr::addnortharrow()
library(prettymapr)
wolfville <- searchbbox("Wolfville NS", source="google")
canvec.qplot(bbox=wolfville)
addscalebar()
addnortharrow()
#or use with prettymapr::prettymap() to set margins and add north arrow/
#scalebar
prettymap(canvec.qplot(bbox=wolfville))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.