pylandstats

Computing landscape metrics in the Python ecosystem

https://github.com/martibosch/pylandstats

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 9 committers (22.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary

Keywords

land-change-analysis landscape-ecology landscape-metrics python raster
Last synced: 6 months ago · JSON representation

Repository

Computing landscape metrics in the Python ecosystem

Basic Info
Statistics
  • Stars: 98
  • Watchers: 3
  • Forks: 16
  • Open Issues: 5
  • Releases: 17
Topics
land-change-analysis landscape-ecology landscape-metrics python raster
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License

README.md

PyPI version fury.io Conda Downloads Documentation Status tests pre-commit.ci status codecov GitHub license

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:

```python import pylandstats as pls

ls = pls.Landscape("../data/processed/veveyse-AS184.tif") ls.plotlandscape(legend=True) ```

landscape-veveyse

  • Compute pandas data frames of landscape metrics at the patch, class and landscape level:

python class_metrics_df = ls.compute_class_metrics_df( metrics=["proportion_of_landscape", "edge_density", "euclidean_nearest_neighbor_mn"] ) class_metrics_df

| classval | proportionoflandscape | edgedensity | euclideannearestneighbor_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:

```python import matplotlib.pyplot as plt

inputfilepaths = [ "../data/processed/veveyse-AS97R4.tif", "../data/processed/veveyse-AS09R4.tif", "../data/processed/veveyse-AS184.tif", ]

sta = pls.SpatioTemporalAnalysis(inputfilepaths, dates=["1992", "2004", "2012"]) sta.plotmetric("contagion") ```

spatiotemporal-analysis

  • 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

  1. 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.

Owner

  • Name: Martí Bosch
  • Login: martibosch
  • Kind: user
  • Location: Lausanne
  • Company: EPFL

Doctor in civil and environmental engineering. Urban sprawl, Python, and a bit of landscape ecology and complexity

GitHub Events

Total
  • Create event: 20
  • Issues event: 8
  • Release event: 5
  • Watch event: 11
  • Delete event: 18
  • Issue comment event: 19
  • Push event: 112
  • Pull request event: 29
Last Year
  • Create event: 20
  • Issues event: 8
  • Release event: 5
  • Watch event: 11
  • Delete event: 18
  • Issue comment event: 19
  • Push event: 112
  • Pull request event: 29

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 323
  • Total Committers: 9
  • Avg Commits per committer: 35.889
  • Development Distribution Score (DDS): 0.316
Past Year
  • Commits: 35
  • Committers: 5
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
Martí Bosch m****h@e****h 221
Martí Bosch m****h@p****m 76
dependabot[bot] 4****]@u****m 9
paugier p****r@u****r 5
martibosch m****h@u****m 4
pre-commit-ci[bot] 6****]@u****m 3
Arjun Chennu a****u@g****m 2
Martí Bosch m****2@g****m 2
martibosch 5****h@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 25
  • Total pull requests: 53
  • Average time to close issues: about 1 year
  • Average time to close pull requests: about 2 months
  • Total issue authors: 22
  • Total pull request authors: 5
  • Average comments per issue: 2.96
  • Average comments per pull request: 1.21
  • Merged pull requests: 32
  • Bot issues: 1
  • Bot pull requests: 29
Past Year
  • Issues: 2
  • Pull requests: 27
  • Average time to close issues: N/A
  • Average time to close pull requests: 14 days
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.22
  • Merged pull requests: 12
  • Bot issues: 1
  • Bot pull requests: 23
Top Authors
Issue Authors
  • emuise (2)
  • simon-tarr (2)
  • ffrosch (2)
  • gislfzhao (1)
  • Baharehfa (1)
  • 1810174827 (1)
  • Momut1 (1)
  • paulomur (1)
  • TGrmn (1)
  • dependabot[bot] (1)
  • cisluis (1)
  • kareed1 (1)
  • mouzui (1)
  • achennu (1)
  • JasperSTV (1)
Pull Request Authors
  • dependabot[bot] (22)
  • martibosch (19)
  • pre-commit-ci[bot] (8)
  • paugier (4)
  • achennu (1)
Top Labels
Issue Labels
dependencies (1)
Pull Request Labels
dependencies (22) github_actions (5)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 852 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 90
  • Total maintainers: 1
proxy.golang.org: github.com/martibosch/pylandstats
  • Versions: 32
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 5.3%
Dependent packages count: 5.4%
Average: 5.5%
Dependent repos count: 5.7%
Forks count: 5.7%
Last synced: 6 months ago
pypi.org: pylandstats

Computing landscape metrics in the Python ecosystem.

  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 852 Last month
Rankings
Dependent packages count: 7.3%
Stargazers count: 8.4%
Downloads: 8.7%
Forks count: 9.4%
Average: 11.2%
Dependent repos count: 22.1%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pylandstats

Open-source Pythonic library to compute landscape metrics in the Python ecosystem (NumPy, pandas, matplotlib...)

  • Versions: 17
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.1%
Stargazers count: 38.8%
Average: 39.0%
Forks count: 41.7%
Dependent packages count: 51.5%
Last synced: 6 months ago

Dependencies

setup.py pypi
  • x.strip *
.github/workflows/release.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • heinrichreimer/github-changelog-generator-action v2.1.1 composite
  • pypa/gh-action-pypi-publish release/v1 composite
  • softprops/action-gh-release v1 composite
.github/workflows/tests.yml actions
  • actions/checkout v4 composite
  • codecov/codecov-action v3 composite
  • mamba-org/setup-micromamba v1 composite
docs/environment.yml pypi
  • pydata-sphinx-theme ==0.13.3
environment.yml pypi
pyproject.toml pypi
  • black *
  • geopandas *
  • matplotlib >= 2.2
  • numba platform_system == 'Windows'
  • numpy >= 1.15
  • pandas >= 0.23
  • rasterio >= 1.0.0
  • scipy >= 1.0.0
  • transonic >= 0.4.0