Short walkthrough and overview of landscapetools

Marco Sciaini


landscapetools is not a coherent package designed for a specific scientific purpose, it is rather a collection of functions to perform some of the less-glamorous tasks involved in landscape analysis.

It is basically designed to accompany all the packages in r-spatialecology and keep them lightweight. Hence, the functionality has a broad spectrum and we try to cover here some things one might miss about landscapetools.


There are a plethora of R packages to visualize spatial data, all of them covering unique aspects and ways to do that (find a short introduction here). With NLMR, we needed a way to visualize landscapes without much fuss and also have a way to visualize many of them in a way we found sufficient.

General raster plotting



In landscape ecology, many people often work with landscapes that reflect a matrix / habitat context. If you work with simulated landscale, util_binarize is a convienent wrapper to achieve this. You can define a value in the range of your landscape values and get a binary reflection of it:


Complementary to util_binarize, util_classify classifies a landscape with continuous values into n discrete classes. The function is quite the workhorse, so I will spent some more details here to explain everything:


util_rescale l linearly rescale element values in a raster to a range between 0 and 1.


util_merge most likely makes sense in the context of NLMR. If you merge multiple neutral landscapes models, you can create more feasible landscape patterns for certain questions, or come up with ecotones if you merge fractal patterns with gradients.


Some propriatery requires that .asc files have the same line breaks as ESRI ArcMap produces. As we didn’t find a correct parser in R, we wrote our on:

util_rescale(fractal_landscape, "fractal.asc")