Skip to content

Commit

Permalink
Fix CHECK errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemahoney218 committed Apr 25, 2024
1 parent 64bc230 commit d2d6580
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Depends:
R (>= 2.10)
8 changes: 8 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
S3method(add_bbox_buffer,Raster)
S3method(add_bbox_buffer,SpatRaster)
S3method(add_bbox_buffer,sf)
S3method(geom_spatial_rgb_internal,RasterStack)
S3method(geom_spatial_rgb_internal,SpatRaster)
S3method(geom_spatial_rgb_internal,character)
S3method(geom_spatial_rgb_internal,default)
S3method(get_tiles,Raster)
S3method(get_tiles,SpatRaster)
S3method(get_tiles,list)
Expand All @@ -11,6 +15,10 @@ S3method(get_tiles,sfc)
S3method(set_bbox_side_length,Raster)
S3method(set_bbox_side_length,SpatRaster)
S3method(set_bbox_side_length,sf)
S3method(stat_spatial_rgb_internal,RasterStack)
S3method(stat_spatial_rgb_internal,SpatRaster)
S3method(stat_spatial_rgb_internal,character)
S3method(stat_spatial_rgb_internal,default)
export(StatSpatialRGB)
export(add_bbox_buffer)
export(combine_overlays)
Expand Down
8 changes: 8 additions & 0 deletions R/geom_spatial_rgb.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ geom_spatial_rgb_internal <- function(data = NULL,
}


#' @export
geom_spatial_rgb_internal.character <- function(data = NULL,
mapping = NULL,
stat = "spatialRGB",
Expand Down Expand Up @@ -156,6 +157,7 @@ geom_spatial_rgb_internal.character <- function(data = NULL,
)
}

#' @export
geom_spatial_rgb_internal.RasterStack <- function(data = NULL,
mapping = NULL,
stat = "spatialRGB",
Expand All @@ -182,6 +184,7 @@ geom_spatial_rgb_internal.RasterStack <- function(data = NULL,
)
}

#' @export
geom_spatial_rgb_internal.SpatRaster <- function(data = NULL,
mapping = NULL,
stat = "spatialRGB",
Expand Down Expand Up @@ -222,6 +225,7 @@ geom_spatial_rgb_internal.SpatRaster <- function(data = NULL,
)
}

#' @export
geom_spatial_rgb_internal.default <- function(data = NULL,
mapping = NULL,
stat = "spatialRGB",
Expand Down Expand Up @@ -325,6 +329,7 @@ stat_spatial_rgb_internal <- function(data = NULL,
UseMethod("stat_spatial_rgb_internal")
}

#' @export
stat_spatial_rgb_internal.character <- function(data = NULL,
mapping = NULL,
geom = "raster",
Expand All @@ -349,6 +354,7 @@ stat_spatial_rgb_internal.character <- function(data = NULL,
)
}

#' @export
stat_spatial_rgb_internal.RasterStack <- function(data = NULL,
mapping = NULL,
geom = "raster",
Expand All @@ -367,6 +373,7 @@ stat_spatial_rgb_internal.RasterStack <- function(data = NULL,
)
}

#' @export
stat_spatial_rgb_internal.SpatRaster <- function(data = NULL,
mapping = NULL,
geom = "raster",
Expand Down Expand Up @@ -399,6 +406,7 @@ stat_spatial_rgb_internal.SpatRaster <- function(data = NULL,
)
}

#' @export
stat_spatial_rgb_internal.default <- function(data = NULL,
mapping = NULL,
geom = "raster",
Expand Down
82 changes: 65 additions & 17 deletions man/geom_spatial_rgb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions tests/testthat/_snaps/add_bbox_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Code
set_bbox_side_length(df_sf, 8000)
Warning <rlang_warning>
Condition
Warning:
No CRS associated with input data.
i Assuming EPSG:4326.
Output
Expand All @@ -11,13 +12,14 @@
Dimension: XY
Bounding box: xmin: -73.97357 ymin: 44.07662 xmax: -73.87337 ymax: 44.14857
Geodetic CRS: WGS 84
Message <simpleMessage>
Message
POLYGON ((-73.97357 44.07662, -73.87337 44.0766...

---

Code
set_bbox_side_length(df_sf, 8000, error_crs = TRUE)
Error <rlang_error>
No CRS associated with input data.
Condition
Error in `add_bbox_buffer()`:
! No CRS associated with input data.

1 change: 1 addition & 0 deletions tests/testthat/test-combine_overlays.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("combine_overlays works", {
skip_if_not_installed("tiff")
x_tmp <- tempfile(fileext = ".png")
y_tmp <- tempfile(fileext = ".png")

Expand Down

0 comments on commit d2d6580

Please sign in to comment.