Skip to content

Commit

Permalink
reverting occ_data changes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Waller committed Apr 23, 2024
1 parent 39eb070 commit d2e087e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions R/geometry_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,19 @@ geometry_handler <- function(x, geom_big = "asis", size = 40, n = 10, verbose =
}
},
axe = {
.Deprecated(msg = "Using 'axe=' is deprecated Since rgbif v3.8.0. Please
.Deprecated(msg = "Using 'axe=' is deprecated Since rgbif v3.8.0. Please
use occ_download(pred_within('...')) instead for complex polygons.")
warning("This might return error or not work correctly, because of new polygon interpretation by GBIF.")
check_for_a_pkg("sf")
check_for_a_pkg("wk")
xsf <- sf::st_as_sfc(x[i])
gt <- sf::st_make_grid(xsf, cellsize = rep(size, 2), n = rep(n, 2))
res <- sf::st_intersection(xsf, gt)
out <- unlist(lapply(res, function(w) {
if (inherits(w, "MULTIPOLYGON")) {
mp2wkt(w)
} else {
sf::st_as_text(w)
}
out
unlist(lapply(res, function(w) {
if (inherits(w, "MULTIPOLYGON")) mp2wkt(w) else sf::st_as_text(w)
}))
}
)

}
unlist(out, recursive = FALSE)

Expand Down

0 comments on commit d2e087e

Please sign in to comment.