- Very simple package with a couple of functions
calculate_prop
for spatial continuitycalculate_tempcont
for temporal continuity- First example using basemap
2024-02-20
calculate_prop
for spatial continuitycalculate_tempcont
for temporal continuityLanduse <- terra::unwrap(Landuse_DK) proportions <- calculate_prop(Rast = Landuse, Radius = 200, Vars = c("dry nature", "Forest"))
Forest <- calculate_prop(Rast = Landuse, Radius = 2400, Vars = c("Forest")) Forest_Motif <- lsp_signature(Landuse, type = "composition", window = 24, normalization = "pdf", ordered = FALSE) Forest_Motif = lsp_add_terra(Forest_Motif) Forest_Motif <- Forest_Motif[[8]]
data(Polygons) data("Landuse_DK") Landuse <- terra::unwrap(Landuse_DK) v <- vect(Polygons, "polygons", crs = terra::crs(Landuse)) Inside <- summarise_polygons(Rast = Landuse, Polygons = v, Vars = c("Agriculture","Forest"))
Agriculture | Forest |
---|---|
0.6039312 | 0.2157248 |
0.8775385 | 0.0381538 |
0.5605780 | 0.2782512 |
0.7852426 | 0.1004881 |
0.7750973 | 0.0630350 |
0.4416529 | 0.3385124 |
0.7544332 | 0.0581369 |
0.5909091 | 0.3315508 |
0.3793361 | 0.3222678 |
0.4157738 | 0.1976190 |
Both <- summarise_polygons(Rast = Landuse, Polygons = v, Vars = c("Agriculture","Forest"), type = "Both", dist = 2000)
Agriculture | Forest |
---|---|
0.5737431 | 0.2219086 |
0.8118472 | 0.0516991 |
0.5648772 | 0.2850265 |
0.7654505 | 0.0939262 |
0.6760861 | 0.1029503 |
0.3280482 | 0.4328941 |
0.7600357 | 0.0705153 |
0.6030322 | 0.2091584 |
0.5709880 | 0.2491674 |
0.4565173 | 0.2167616 |
Outside <- summarise_polygons(Rast = Landuse, Polygons = v, Vars = c("Agriculture","Forest"), type = "Outside", dist = 2000)
Agriculture | Forest |
---|---|
0.5655868 | 0.2235794 |
0.7980718 | 0.0553473 |
0.5669460 | 0.2882867 |
0.7538020 | 0.0900642 |
0.6551351 | 0.1107336 |
0.2701062 | 0.4810319 |
0.7637145 | 0.0823436 |
0.6046186 | 0.1931421 |
0.6656837 | 0.2130483 |
0.4782954 | 0.2374272 |
data(corine) corine <- terra::unwrap(corine)
TempContOrd <- calculate_tempcont(Rast = corine, Vars = c("Coniferous forest" ,"Mixed forest"))
TempContNum <- calculate_tempcont(Rast = corine, years = c(1990, 2000, 2006, 2012, 2018), Vars = c("Coniferous forest" ,"Mixed forest"))
write_cog(TempContNum, "TempContNum.tif") terra::writeRaster(TempContNum, "TempContNum2.tif") file.size("TempContNum.tif")
## [1] 202060
file.size("TempContNum2.tif")
## [1] 710850