st_perimeter has a check such as: Error in if (st_is_longlat(x))
unfortunately, this will fail if the st_is_longlat(x) is NA, with error message:
Error in if (st_is_longlat(x)) stop("for perimeter of longlat geometry, cast to LINESTRING and use st_length") : missing value where TRUE/FALSE needed
Could the function handle this case? Maybe if (isTRUE(st_is_longlat(x))) ? Or return stop in any case?
st_perimeter
has a check such as:Error in if (st_is_longlat(x))
unfortunately, this will fail if the
st_is_longlat(x)
isNA
, with error message: Error in if (st_is_longlat(x)) stop("for perimeter of longlat geometry, cast to LINESTRING and use st_length") : missing value where TRUE/FALSE neededCould the function handle this case? Maybe
if (isTRUE(st_is_longlat(x)))
? Or return stop in any case?Thanks!