From b4e0501cd59161721cdba7082ce75447acacb448 Mon Sep 17 00:00:00 2001 From: edzer Date: Tue, 27 Aug 2024 17:36:15 +0200 Subject: [PATCH] simplify --- R/proxy.R | 5 +---- R/subset.R | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/R/proxy.R b/R/proxy.R index 8e617a4d..61c5e3ef 100644 --- a/R/proxy.R +++ b/R/proxy.R @@ -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 diff --git a/R/subset.R b/R/subset.R index dae08cf3..99c6a01f 100644 --- a/R/subset.R +++ b/R/subset.R @@ -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)