-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I created a small example to show the issue: landscape2. When using the landscapemetrics package the value returned by lsm_l_te is 140: it counts all of the outer borders (120) plus the border between two classes (20).
library(terra)
library(landscapemetrics)
data("landscape")
landscape = rast(landscape)
landscape2 = aggregate(landscape, 10, fun = "modal", na.rm = TRUE)
lsm_l_te(landscape2, count_boundary = TRUE)$value
#> [1] 140
plot(landscape2)On the other hand, the vectormetrics double count the border between these classes, and thus the result is 160 (120 + 20 * 2).
@mhesselbarth -- can you confirmed that the landscapemetrics result/approach is as expected?
library(terra)
library(sf)
library(vectormetrics)
library(landscapemetrics)
data("landscape")
landscape = rast(landscape)
landscape2 = aggregate(landscape, 10, fun = "modal", na.rm = TRUE)
landscape2_v = st_as_sf(as.polygons(landscape2))
landscape2_v = st_cast(landscape2_v, "POLYGON")
vm_l_te(landscape2_v)$value
#> [1] 160Metadata
Metadata
Assignees
Labels
No labels
