Computing landscape metrics in the Python ecosystem.
Project description
PyLandStats
Open-source library to compute landscape metrics in the Python ecosystem (NumPy, pandas, matplotlib...)
Citation: Bosch M. 2019. "PyLandStats: An open-source Pythonic library to compute landscape metrics". PLOS ONE, 14(12), 1-19. doi.org/10.1371/journal.pone.0225734
Features
-
Read GeoTiff files of land use/cover:
import pylandstats as pls ls = pls.Landscape("../data/processed/veveyse-AS18_4.tif") ls.plot_landscape(legend=True)
-
Compute pandas data frames of landscape metrics at the patch, class and landscape level:
class_metrics_df = ls.compute_class_metrics_df( metrics=["proportion_of_landscape", "edge_density", "euclidean_nearest_neighbor_mn"] ) class_metrics_df
class_val proportion_of_landscape edge_density euclidean_nearest_neighbor_mn 1 7.749572 19.102211 309.244705 2 56.271868 50.599270 229.079970 3 33.946252 38.167200 253.299859 4 2.032308 3.722177 552.835154 -
Analyze the spatio-temporal evolution of landscapes:
import matplotlib.pyplot as plt input_filepaths = [ "../data/processed/veveyse-AS97R_4.tif", "../data/processed/veveyse-AS09R_4.tif", "../data/processed/veveyse-AS18_4.tif", ] sta = pls.SpatioTemporalAnalysis(input_filepaths, dates=["1992", "2004", "2012"]) sta.plot_metric("contagion")
-
Zonal analysis of landscapes
See the documentation and the pylandstats-notebooks repository for a more complete overview.
Installation
The easiest way to install PyLandStats is with conda:
$ conda install -c conda-forge pylandstats
which will install PyLandStats and all of its dependencies. Alternatively, you can install PyLandStats using pip:
$ pip install pylandstats
Nevertheless, note that in order to define zones by vector geometries in ZonalAnalysis
, or in order to use the the BufferAnalysis
and SpatioTemporalBufferAnalysis
classes, PyLandStats requires geopandas, which cannot be installed with pip. If you already have the dependencies for geopandas installed in your system, you might then install PyLandStats with the geo
extras as in:
$ pip install pylandstats[geo]
and you will be able to use the aforementioned features (without having to use conda).
Development install
To install a development version of PyLandStats, you can first use conda to create an environment with all the dependencies and activate it as in:
$ conda create -n pylandstats -c conda-forge geopandas matplotlib-base rasterio scipy openblas
$ conda activate pylandstats
and then clone the repository and use pip to install it in development mode
$ git clone https://github.com/martibosch/pylandstats.git
$ cd pylandstats/
$ pip install -e .
Acknowledgments
- The computation of the adjacency matrix in transonic has been implemented by Pierre Augier (paugier)
- Several information theory-based metrics from Nowosad and Stepinski [1] were added by achennu
- With the support of the École Polytechnique Fédérale de Lausanne (EPFL)
- The Corine Land Cover datasets used for the test datasets were produced with funding by the European Union
References
- Nowosad, J., & Stepinski, T. F. (2019). Information theory as a consistent framework for quantification and classification of landscape patterns. Landscape Ecology, 34(9), 2091-2101.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pylandstats-3.0.0rc1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b04746e90f7feab3275cc2ce4adb79c94095fb3017eb6da9f35d92c3b095963 |
|
MD5 | df4536d93e027b0c71589177c0a02fed |
|
BLAKE2b-256 | fdf22ef2ab6f17c8ce1dc6f645cdc9feb6b00684b2d3b25ed55f1e0b382d1da9 |
Hashes for pylandstats-3.0.0rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2dcced89da4d4c44baba70bd35f2215774bf2cc679acad639f49467cf5b2cf4 |
|
MD5 | 0bb774a197ab17398074675a43ddf819 |
|
BLAKE2b-256 | ff179487101a839f155e6ef0df24b7150774999e72ff1180be4e54aeddfa2837 |
Hashes for pylandstats-3.0.0rc1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ef3b2e4d69ba13cac6340abdb05902be30620107eab80b7e8088e9837dab9ed |
|
MD5 | 8bc8fbc601c2df3b850e217a8d01595a |
|
BLAKE2b-256 | c7de416f56e9df29fa81ea01a3d81d5a518aea28fa5ebdc984d8a48a1fac08ad |
Hashes for pylandstats-3.0.0rc1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baafe6fba8e398d239884c9b5bccdcffc9bd71ea1a92f7da02bba149f934621d |
|
MD5 | a889c03e9e1c61bf6e64b86044944423 |
|
BLAKE2b-256 | 8ab1936c1fb5a7a47836ff52f692226ee95cfbf58b2f911b0a66b420eceaaf2c |
Hashes for pylandstats-3.0.0rc1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a32c316095308d6563b87f330699d5e78f90bfe208e0ab608cdebb8af25572c |
|
MD5 | 933c53e7ff84ea865490238937ce438f |
|
BLAKE2b-256 | 53848603096ddd6eb37eed394c07b3e596d53cc39c5c346292df924e359bb292 |
Hashes for pylandstats-3.0.0rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea971049f15505951cfbc011f0960352e1c0f2c7fa51efc3e3c1af4afd424a53 |
|
MD5 | 367b3bfdefa4b40c99caa09935bb7349 |
|
BLAKE2b-256 | 23d27e0f528ed27412f2395e1ac891a5173de3b9b1c1d0b80a40c13dfc321828 |
Hashes for pylandstats-3.0.0rc1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f34b49435adc7bf483f22dbf588f0eb41b00509d80815a5d76eebaf9ea70257f |
|
MD5 | df45c1f34d1c5ad86ff7b9f2c59248c2 |
|
BLAKE2b-256 | 0c9e49b11c5b554f46d6f87e9fffead867285074931dd86cba00630badae5fac |
Hashes for pylandstats-3.0.0rc1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c5049db431befd7835367498d30969609c0bf7592b8eb58885a03d96a32ddc6 |
|
MD5 | 872dac27836d5274c2c5d5838b1f0674 |
|
BLAKE2b-256 | dcf59da698f53aae56436b01157a8f792bb03f922b3509fe5e75d30c6b8d1677 |
Hashes for pylandstats-3.0.0rc1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c1c6baec707e4baa6e69b0e3e0242a3f98d7457bf02664dff56aac4a170c2bc |
|
MD5 | 2d546a2711c048c2cadacecfeb2927b1 |
|
BLAKE2b-256 | b03ea8a8a58ffcabe9b08208bed5bd06909b4f79c9f38d02e636849345f5f8d0 |
Hashes for pylandstats-3.0.0rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf1081333669015fa0e280488352952bc3463516dccf562c80286f261a0a0e5b |
|
MD5 | 428d86a003bf4cd8fd6c4bc56f2b8c15 |
|
BLAKE2b-256 | e351f96cb4840452ad8c5ff44bb28a7b62b9005b95e5cb54b1f933163774ec18 |
Hashes for pylandstats-3.0.0rc1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52eef5dcbbfba6ae781392a9671a8a93595ea456c777b642059c45f2bec6e17 |
|
MD5 | e1ae6d4b62bfd71c8d8dabedbba89191 |
|
BLAKE2b-256 | f6ad71c83d9ee6aae1b2b32164f24f0dda8a7e3a3e746a525d89e4e5ba0e9c93 |
Hashes for pylandstats-3.0.0rc1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b4d9a237058e285c01324b25ce290eac4795d9558eaaccfc1ac3eec3bbfaaf1 |
|
MD5 | 28ebcd3952ad9757578f9f4ec0d930b8 |
|
BLAKE2b-256 | 3ab09118c8452455c0648dc0a51bbbfd72845d2c9d7f2397c4c487376d1539dd |
Hashes for pylandstats-3.0.0rc1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f865fa431ada67b0a842fc60756d8c83030f39757d02723c3252e8f32eac9ee |
|
MD5 | c3a4e9f358bb2ac4630563e15c9f11fe |
|
BLAKE2b-256 | 397c9bf5ade037d4b65f84d6cf867ad61e7a133691d2b621c506b893247ead93 |
Hashes for pylandstats-3.0.0rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73d0ea642fa311fde3d820d4463181e5613f008801ab65262ce831cf2d0bb67 |
|
MD5 | 32041ffa939feb63635dbe6cef68bf66 |
|
BLAKE2b-256 | ae9810e6edb00e5ec1b70192e60dc9a7aed298c547dc0c828af8ee8ec2eaeba4 |
Hashes for pylandstats-3.0.0rc1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942bdf7563cb5a18df41fee92a6d000dc254ca3979e2b9358eff3352ba9716c3 |
|
MD5 | 5c14369ee7017c59b0c69e34ea339823 |
|
BLAKE2b-256 | 976479dedfd20a7973cd1c9fb17e8ab5b100342328937b5eefc9a1654fbc8ddf |
Hashes for pylandstats-3.0.0rc1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09cf5335385f1f1dcff230867c8265141fa2a5372b21efddf784ed77dfc8447a |
|
MD5 | 7215cca7e81553c1d71005c43830cb82 |
|
BLAKE2b-256 | e3953c376c4a8720589077ca8c2a0974abeaf09c15dc640d7e61d8ef465bc059 |