Skip to content

Commit

Permalink
Merge pull request #22 from paleolimbot/development
Browse files Browse the repository at this point in the history
fix CRAN problems of file size and test run time
  • Loading branch information
paleolimbot authored Jul 12, 2018
2 parents beb3b74 + e9f2834 commit e1c459e
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 232 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^README\.md$
^\.travis\.yml$
^codecov\.yml$
^tests/testthat/Rplots\.pdf$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggspatial
Type: Package
Title: Spatial Data Framework for ggplot2
Version: 1.0.0
Version: 1.0.1
Authors@R: c(
person("Dewey", "Dunnington", , "[email protected]", c("aut", "cre")),
person("Brent", "Thorne", role = "ctb")
Expand Down
2 changes: 1 addition & 1 deletion README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output: github_document

```{r setup, include = FALSE}
rosm::set_default_cachedir(system.file("rosm.cache", package = "ggspatial"))
knitr::opts_chunk$set(dpi = 300, echo = TRUE)
knitr::opts_chunk$set(dpi = 150, echo = TRUE)
```

Spatial data plus the power of the `ggplot2` framework means easier mapping.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 65 additions & 60 deletions tests/testthat/test-annotation-map-tile.R
Original file line number Diff line number Diff line change
@@ -1,68 +1,73 @@
context("test-geom-osm.R")

test_that("geom_osm works as intended", {
load_longlake_data()
# max test length was exceeded on CRAN, so these tests are skipped
if (identical(Sys.getenv("NOT_CRAN"), "true")) {

expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)
test_that("geom_osm works as intended", {
load_longlake_data()

expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 26920) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)
expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)

expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3857) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)
expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 26920) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)

expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3978) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)
expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3857) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)

expect_message(
print(
ggplot() +
annotation_map_tile(
data = tibble::tibble(
type = c("osm", "stamenbw", "cartolight", "cartodark"),
zoom = 13
),
cachedir = system.file("rosm.cache", package = "ggspatial"),
mapping = aes(type = type, zoom = zoom)
) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3857) +
facet_wrap(~type) +
labs(caption = "this should have the maptypes correspond to the backdrop")
),
"Zoom: 13"
)
expect_message(
print(
ggplot() +
annotation_map_tile(zoom = 13, cachedir = system.file("rosm.cache", package = "ggspatial")) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3978) +
labs("This plot sould have they grey outlines line up with the OSM map beneath")
),
"Zoom: 13"
)

})
expect_message(
print(
ggplot() +
annotation_map_tile(
data = tibble::tibble(
type = c("osm", "stamenbw", "cartolight", "cartodark"),
zoom = 13
),
cachedir = system.file("rosm.cache", package = "ggspatial"),
mapping = aes(type = type, zoom = zoom)
) +
geom_sf(data = longlake_waterdf, fill = NA, col = "grey50") +
coord_sf(crs = 3857) +
facet_wrap(~type) +
labs(caption = "this should have the maptypes correspond to the backdrop")
),
"Zoom: 13"
)

})

}
Loading

0 comments on commit e1c459e

Please sign in to comment.