Skip to main content

Open-source Python library to compute landscape metrics

Project description

PyPI version fury.io Build Status Coverage Status GitHub license

PyLandStats

Overview

Open-source Pythonic library to compute landscape metrics within the PyData stack (NumPy, pandas, matplotlib...)

Features

Read GeoTiff files of land use/cover

import pylandstats as pls

ls = pls.read_geotiff('data/vaud_g100_clc00_V18_5.tif')

ls.plot_landscape(legend=True)

Compute pandas DataFrames of landscape metrics at the patch, class and landscape level

patch_metrics_df = ls.compute_patch_metrics_df()
patch_metrics_df.head()

patch_id class_val area perimeter perimeter_area_ratio shape_index fractal_dimension


     0            1     115        10600                 92.1739        2.40909              1.12965
     1            1      13         2600                200             1.625                1.1001
     2            1       2          600                300             1                    1.01189
     3            1      69         6000                 86.9565        1.76471              1.08792
     4            1      76         8800                115.789         2.44444              1.13672
class_metrics_df = ls.compute_class_metrics_df(metrics=['proportion_of_landscape', 'edge_density'])
class_metrics_df

class_val proportion_of_landscape edge_density


      1                    7.70194         4.45877
      2                   92.2981          4.45877
landscape_metrics_df = ls.compute_landscape_metrics_df(metrics=['edge_density', 'shannon_diversity_index'])
landscape_metrics_df
  edge_density    shannon_diversity_index

0 4.45877 0.271429

See the pylandstats-notebooks repository for a more complete overview

Installation

To install use pip:

$ pip install pylandstats

Or clone the repo:

$ git clone https://github.com/martibosch/pylandstats.git
$ python setup.py install

TODO

  • Register project to PyPI
  • Add encrypted password to .travis.yml for automated PyPI releases

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylandstats-0.0.1.tar.gz (15.2 kB view hashes)

Uploaded Source

Built Distribution

pylandstats-0.0.1-py2.py3-none-any.whl (28.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page