tests/testthat/helper-geomattR.R

skip_if_proj_unavailable <- function() {
  probe <- suppressWarnings(
    try(
      terra::vect(
        cbind(c(0, 0, 1, 1, 0), c(0, 1, 1, 0, 0)),
        type = "polygon",
        crs = "EPSG:4326"
      ),
      silent = TRUE
    )
  )

  if (inherits(probe, "try-error") || !nzchar(terra::crs(probe))) {
    testthat::skip("PROJ database is unavailable")
  }
}

Try the geomattR package in your browser

Any scripts or data that you put into this service are public.

geomattR documentation built on Oct. 18, 2026, 5:08 p.m.