Skip to content

Commit

Permalink
get_SDA_coecoclass: aggregate queries more efficient handling of mult…
Browse files Browse the repository at this point in the history
…i-areasymbol input
  • Loading branch information
brownag committed Nov 16, 2023
1 parent 62c6149 commit e542406
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/get_SDA_coecoclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,11 @@ get_SDA_coecoclass <- function(method = "None",
mukey <- NULL; .N <- NULL; .SD <- NULL; .GRP <- NULL;

if (!is.null(areasymbols)) {
res0 <- do.call('rbind', lapply(areasymbols, function(x) {
.SSURGO_query(paste0(
res0 <- .SSURGO_query(paste0(
"SELECT DISTINCT mukey, nationalmusym, muname FROM mapunit
INNER JOIN legend ON legend.lkey = mapunit.lkey
WHERE areasymbol = '", x, "'"
WHERE areasymbol IN ", format_SQL_in_statement(areasymbols)
))
}))
idx <- makeChunks(res0$mukey, 1000)
l <- split(res0$mukey, idx)
} else {
Expand Down

0 comments on commit e542406

Please sign in to comment.