Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 27, 2024
1 parent 250ede1 commit b4e0501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions R/proxy.R
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,7 @@ st_crop.stars_proxy = function(x, y, ..., crop = TRUE, epsilon = sqrt(.Machine$d
rast = attr(dm, "raster")$dimensions
xd = rast[1]
yd = rast[2]
bb = if (!inherits(y, "bbox"))
st_bbox(y)
else
y
bb = st_bbox(y)
if (epsilon != 0)
bb = bb_shrink(bb, epsilon)
# FIXME: document how EXACTLY cropping works; https://github.com/hypertidy/tidync/issues/73
Expand Down
5 changes: 1 addition & 4 deletions R/subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,7 @@ st_crop.stars = function(x, y, ..., crop = TRUE, epsilon = sqrt(.Machine$double.
rastxy = attr(dm, "raster")$dimensions
xd = rastxy[1]
yd = rastxy[2]
bb = if (!inherits(y, "bbox"))
st_bbox(y)
else
y
bb = st_bbox(y)
if (any(is.na(as.numeric(bb)))) # as.numeric() can go after sf 0.7-5
stop("NA values in bounding box of y")
if (epsilon != 0)
Expand Down

0 comments on commit b4e0501

Please sign in to comment.