Skip to content

Commit

Permalink
fix: remove error when CRS do not match between x and mask
Browse files Browse the repository at this point in the history
  • Loading branch information
rCarto committed Jul 7, 2022
1 parent 1243493 commit db64ba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions R/mapiso.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ mapiso <- function(x, var, breaks, nbreaks = 8, mask, coords, crs) {
if (st_crs(iso) == st_crs(mask)) {
iso <- st_cast(st_intersection(x = iso, y = st_union(st_geometry(mask))))
} else {
stop(
"CRS of 'x' and 'mask' should be identical.",
call. = FALSE
cat(
"CRS of 'x' and 'mask' should be identical, polygons are not clipped."
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/test_mapiso.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ expect_silent(mapiso(x = d, var = 'elevation', coords = c('x', 'y'),

expect_error(mapiso("textx"))

expect_error(mapiso(x = s, var = "elevation", breaks = bks,
expect_silent(mapiso(x = s, var = "elevation", breaks = bks,
mask = st_transform(m, 4326)))


Expand Down

0 comments on commit db64ba2

Please sign in to comment.