Skip to content

Commit

Permalink
fetch_mukeys_spatially_NRCS_SDA(): sp is suggested instead of imported
Browse files Browse the repository at this point in the history
- contribute to #12
- sp is only used if soilDB < 2.6.10 is used
  • Loading branch information
dschlaep committed May 23, 2023
1 parent 871c113 commit 778e777
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Imports:
terra,
raster,
reshape2,
sf,
sp
sf
Suggests:
FedData (>= 3.0.2),
soilDB (>= 2.5.7),
sp,
utils,
testthat (>= 3.0.0),
spelling,
Expand Down
2 changes: 2 additions & 0 deletions R/extract_soils_NRCS_SDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ fetch_mukeys_spatially_NRCS_SDA <- function(
locations <- rSW2st::as_points(x, to_class = "sf", crs = crs)
nxlocs <- nrow(locations)
} else {
stopifnot(requireNamespace("sp"))
locations <- rSW2st::as_points(x, to_class = "sp", crs = crs)
nxlocs <- length(locations)
}
Expand Down Expand Up @@ -534,6 +535,7 @@ fetch_mukeys_spatially_NRCS_SDA <- function(
as.vector(res_mukeys[ids, "mukey", drop = TRUE])

} else if (inherits(locations, "Spatial")) {
# sp is only used if soilDB < 2.6.10
sp::over(
x = sp::spTransform(
locations[ids_chunks[[k]], ],
Expand Down

0 comments on commit 778e777

Please # to comment.