addPolyline() with SpatVector fails if terra is not loaded because check_crs_terra() is missing depency terra::crs
mkoohafkan opened this issue · comments
When {terra}
is not loaded (e.g., individual {terra}
functions are imported into package namespace) functions that internally call check_crs_terra()
will fail. I think this is because check_crs_terra()
simply calls crs()
instead of terra::crs()
:
Lines 74 to 94 in d8c9794
I encounter this issue when calling addPolylines()
with SpatVector
objects.
Possible fix:
- Add
{rlang}
as Import package - Call
rlang::check_installed("terra")
withincheck_crs_terra()
Or use wch
's staticimports for checking if package is installed.
I think it's a little of all of the above, but mostly the fix is to call terra::crs()
rather than crs()
.