Skip to content

Commit

Permalink
check for min version of GDAL for writing .shz
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Sep 12, 2024
1 parent 68e425f commit 09f1b29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/tar-terra-vect.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ create_format_terra_vect <- function() {
create_format_terra_vect_shz <- function() {

check_pkg_installed("terra")
#difficult to test
if (terra::gdal(lib = "gdal") < "3.1") {
rlang::abort("Writing a .shz file requires GDAL version 3.1 or greater")
}

targets::tar_format(
read = function(path) terra::vect(paste0("/vsizip/{", path, "}")),
Expand Down

0 comments on commit 09f1b29

Please sign in to comment.