Skip to content

Commit e4f990a

Browse files
committed
updated manual, corrected errors in examples
1 parent 7861831 commit e4f990a

File tree

6 files changed

+49
-37
lines changed

6 files changed

+49
-37
lines changed

R/basemap.R

+16-14
Original file line numberDiff line numberDiff line change
@@ -39,47 +39,49 @@
3939
#'
4040
#' # set defaults for the basemap
4141
#' set_defaults(map_service = "osm", map_type = "terrain_bg")
42-
#' # for "osm_stamen", "osm_stadia", osm "thunderforest", "maptiler" and "mapbox" maps, you need a API token.
43-
#' # Register for free at stadiamaps.com, thunderforest.com, maptiler.com and mapbox.com to get tokens.
42+
#' # for "osm_stamen", "osm_stadia", osm "thunderforest", "maptiler" and "mapbox" maps,
43+
#' # you need a API token. Register for free at stadiamaps.com, thunderforest.com,
44+
#' # maptiler.com and mapbox.com to get tokens.
4445
#'
4546
#' \dontrun{
46-
#' # load and return basemap map as raster (default)
47+
#' # load and plot basemap (default)
4748
#' map <- basemap(ext)
4849
#'
4950
#' # or explicitely as different classes such as:
5051
#' basemap_magick(ext)
51-
#' basemap_raster()
52-
#' basemap_stars()
52+
#' basemap_raster(ext)
53+
#' basemap_stars(ext)
5354
#'
5455
#' # or as files:
55-
#' basemap_geotif()
56-
#' basemap_png()
56+
#' basemap_geotif(ext)
57+
#' basemap_png(ext)
5758
#'
5859
#' # or as plots:
5960
#' basemap_plot(ext)
60-
#' basemap_mapview()
61+
#' basemap_mapview(ext)
6162
#'
6263
#' # including ggplot2:
6364
#' basemap_ggplot(ext)
6465
#'
6566
#' # or as ggplot2 layer:
6667
#' library(ggplot2)
67-
#' ggplot() +
68-
#' basemap_gglayer(ext) +
69-
#' scale_fill_identity() +
68+
#' ggplot() +
69+
#' basemap_gglayer(ext) +
70+
#' scale_fill_identity() +
7071
#' coord_sf()
7172
#'
7273
#' # or, when combined with an sf vector object,
7374
#' # make sure to use Web/Pseudo Mercator (EPSG 3857), as this is
7475
#' # the CRS in which all basemaps are returned (see "Value"):
7576
#' library(sf)
7677
#' ext <- st_transform(ext, crs = st_crs(3857))
77-
#' ggplot() +
78-
#' basemap_gglayer(ext) +
78+
#' ggplot() +
79+
#' basemap_gglayer(ext) +
7980
#' geom_sf(data = ext, color = "red", fill = "transparent") +
8081
#' coord_sf() +
8182
#' scale_fill_identity()
82-
#' }
83+
#' }
84+
#'
8385
#' @importFrom sf st_bbox
8486
#' @importFrom terra rast plotRGB plot as.array nlyr
8587
#' @importFrom graphics plot

R/plot.R

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@
2222
#' data(ext)
2323
#'
2424
#' \dontrun{
25-
#' # raster object: Brick
26-
#' map <- basemap_raster(ext)
25+
#' # terra raster object
26+
#' map <- basemap_terra(ext)
2727
#'
28-
#' # plotting RasterBrick
28+
#' # plotting raster as ggplot using the with fill aesthetic
2929
#' gg_raster(map, r_type = "RGB")
30+
#'
31+
#' # or as gg layer using the with fill aesthetic
32+
#' ggplot() + gg_raster(map, r_type = "RGB", gglayer = T) + scale_fill_identity()
3033
#' }
3134
#'
3235
#' @importFrom terra rast ncell aggregate aggregate

man/basemap.Rd

+17-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/defaults.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_maptypes.Rd

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.Rd

+6-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)