Skip to content

Commit 0183752

Browse files
committed
fix osm inheritance error, trim examples to help with check time
1 parent a599505 commit 0183752

7 files changed

+11
-24
lines changed

R/geom-osm.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#' library(prettymapr)
3939
#' # use as a backdrop for geographical data
4040
#' cities <- geocode(c("Halifax, NS", "Moncton, NB", "Montreal QC"))
41-
#' ggplot(cities, aes(lon, lat)) + geom_osm() +
41+
#' ggplot(cities, aes(lon, lat, shape = query)) + geom_osm() +
4242
#' geom_point() + coord_map()
4343
#'
4444
#' # use ggosm() shorthand
@@ -76,6 +76,7 @@ geom_osm <- function(x = NULL, zoomin=0, zoom=NULL, type=NULL, forcedownload=FAL
7676
# return GeomTileSource layer
7777
layer(data = data, mapping = ggplot2::aes_string("x", "y"),
7878
position = "identity", geom = GeomTileSource, stat = "identity",
79+
show.legend = FALSE, inherit.aes = FALSE,
7980
params = list(na.rm = TRUE, zoomin = zoomin, zoom = zoom, type = type,
8081
forcedownload = forcedownload,
8182
cachedir = cachedir, progress = progress, quiet = quiet))

R/geom-spatial.R

-9
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,14 @@
3838
#' }
3939
#'
4040
#' # plot a number of spatial objects
41-
#' data(longlake_marshdf, longlake_roadsdf, longlake_waterdf, longlake_depthdf,
42-
#' longlake_streamsdf, longlake_buildingsdf)
4341
#' ggplot() +
4442
#' geom_spatial(longlake_waterdf, fill="lightblue") +
4543
#' geom_spatial(longlake_marshdf, fill="grey", alpha=0.5) +
4644
#' geom_spatial(longlake_streamsdf, col="lightblue") +
4745
#' geom_spatial(longlake_roadsdf, col="black") +
4846
#' geom_spatial(longlake_buildingsdf, pch=1, col="brown", size=0.25) +
49-
#' geom_spatial(longlake_depthdf, aes(col=DEPTH.M)) +
50-
#' facet_wrap(~NOTES)+
5147
#' coord_map()
5248
#'
53-
#'
54-
#' library(maptools)
55-
#' data(wrld_simpl)
56-
#' ggplot() + geom_spatial(wrld_simpl)
57-
#'
5849
geom_spatial <- function(data, ...) UseMethod("geom_spatial")
5950

6051

R/geom-spraster.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ geom_spraster_rgb <- function(raster, interpolate = FALSE, na.value = NA) {
195195
#' @examples
196196
#' # standard ggplot syntax
197197
#' ggplot() + geom_spatial(longlake_osm, aes(fill = band1)) + coord_fixed()
198-
#'
198+
#' \donttest{
199199
#' # or use ggraster()
200200
#' ggraster(longlake_osm, aes(fill = band1))
201+
#' }
201202
#'
202203
geom_spatial.Raster <- function(data, mapping = NULL, show.legend = TRUE, inherit.aes=FALSE,
203204
position = "identity", crsfrom = crsfrom, crsto = crsto,
@@ -269,10 +270,11 @@ ggraster <- function(data, mapping = NULL, ...) {
269270
#' limits_red = NULL, limits_green = NULL, limits_blue = NULL,
270271
#' limits_alpha = NULL, interpolate = TRUE) +
271272
#' coord_fixed()
272-
#'
273+
#' \donttest{
273274
#' # using ggraster() with stat = 'rgba'
274275
#' ggraster(longlake_osm, aes(red = band1, green = band2, blue = band3, alpha = 1),
275276
#' stat = "rgba")
277+
#' }
276278
#'
277279
stat_rgba <- function(mapping = NULL, data = NULL, ..., limits_red = NA, limits_green = NA,
278280
limits_blue = NA, limits_alpha = NA) {

man/geom_osm.Rd

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

man/geom_spatial.Raster.Rd

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

man/geom_spatial.Rd

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

man/stat_rgba.Rd

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

0 commit comments

Comments
 (0)