landscapemetrics | Landscape Metrics for Categorical Map Patterns 🗺️ in R | Data Visualization library
kandi X-RAY | landscapemetrics Summary
kandi X-RAY | landscapemetrics Summary
landscapemetrics is a R package for calculating landscape metrics for categorical landscape patterns in a tidy workflow. The package can be used as a drop-in replacement for FRAGSTATS (McGarigal et al. 2012), as it offers a reproducible workflow for landscape analysis in a single environment. It also allows for calculations of four theoretical metrics of landscape complexity: a marginal entropy, a conditional entropy, a joint entropy, and a mutual information (Nowosad and Stepinski 2019). landscapemetrics supports raster, terra, and stars spatial objects and takes RasterLayer, RasterStacks, RasterBricks lists of RasterLayer, SpatRaster, or stars as input arguments. Every function can be used in a piped workflow, as it always takes the data as the first argument and returns a tibble.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of landscapemetrics
landscapemetrics Key Features
landscapemetrics Examples and Code Snippets
Community Discussions
Trending Discussions on landscapemetrics
QUESTION
I am running a moving window function from the package landscapemetrics. This seems to take some time as the raster is quite big. It would be really helpful to have a progress bar or something similar. How can I code something like this without having a for loop or a self-coded function to begin with? I don't know how to provide an example raster, but here is my code:
...ANSWER
Answered 2022-Feb-14 at 17:57Not familiar with this package, but window_lsm()
has an argument progress
which will "print progress report" when TRUE
.
Otherwise, to the best of my knowledge it's not possible to implement a true progress bar without any kind of iteration / loop. The one other option I see would be to look at the source of window_lsm()
; find the outermost loop (if there is one); define your own local version of the function; and insert a progress bar incremented inside the loop (e.g. using the progress
package). (Obviously, you wouldn't want to redistribute this without looking into the licensing / discussing with package devs.)
I guess another option would be to somehow develop an estimate of how long the operation might take, e.g., based on the size of your raster, then run a countdown timer in a parallel process? My hunch is this would be hard to implement and not especially accurate.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install landscapemetrics
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page