py-rasterstats

Summary statistics of geospatial raster datasets based on vector geometries.

https://github.com/perrygeo/python-rasterstats

Science Score: 23.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
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 32 committers (9.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords from Contributors

cython gdal mapbox-satellite-oss ogr closember geospatial-data qt tensor
Last synced: 10 months ago · JSON representation

Repository

Summary statistics of geospatial raster datasets based on vector geometries.

Basic Info
  • Host: GitHub
  • Owner: perrygeo
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.06 MB
Statistics
  • Stars: 549
  • Watchers: 30
  • Forks: 115
  • Open Issues: 38
  • Releases: 14
Created almost 13 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License

README.rst

rasterstats
===========

|BuildStatus|_

``rasterstats`` is a Python module for summarizing geospatial raster datasets based on vector geometries.
It includes functions for **zonal statistics** and interpolated **point queries**. The command-line interface allows for
easy interoperability with other GeoJSON tools.

Documentation
-------------
For details on installation and usage, visit the documentation at `http://pythonhosted.org/rasterstats `_.

What does it do?
----------------
Given a vector layer and a raster band, calculate the summary statistics of each vector geometry.
For example, with a polygon vector layer and a digital elevation model (DEM) raster, compute the
mean elevation of each polygon.

.. figure:: https://github.com/perrygeo/python-raster-stats/raw/master/docs/img/zones_elevation.png
   :align: center
   :alt: zones elevation

Command Line Quick Start
------------------------

The command line interfaces to zonalstats and point_query
are `rio` subcommands which read and write geojson features

.. code-block:: bash

    $ fio cat polygon.shp | rio zonalstats -r elevation.tif

    $ fio cat points.shp | rio pointquery -r elevation.tif

See the `CLI Docs `_. for more detail.

Python Quick Start
------------------

For zonal statistics

.. code-block:: python

    >>> from rasterstats import zonal_stats
    >>> stats = zonal_stats("tests/data/polygons.shp", "tests/data/slope.tif")
    >>> stats[0].keys()
    dict_keys(['min', 'max', 'mean', 'count'])
    >>> [f['mean'] for f in stats]
    [14.660084635416666, 56.60576171875]

and for point queries

.. code-block:: python

    >>> from rasterstats import point_query
    >>> point = {'type': 'Point', 'coordinates': (245309.0, 1000064.0)}
    >>> point_query(point, "tests/data/slope.tif")
    [74.09817594635244]


Issues
------

Find a bug? Report it via github issues by providing

- a link to download the smallest possible raster and vector dataset necessary to reproduce the error
- python code or command to reproduce the error
- information on your environment: versions of python, gdal and numpy and system memory

.. |BuildStatus| image:: https://github.com/perrygeo/python-rasterstats/workflows/Rasterstats%20Python%20package/badge.svg
.. _BuildStatus: https://github.com/perrygeo/python-rasterstats/actions

Owner

  • Name: Matthew Perry
  • Login: perrygeo
  • Kind: user
  • Location: Fort Collins, CO

Geospatial Data Engineer, using ML and Remote Sensing to build high-quality forest carbon credits @pachama

GitHub Events

Total
  • Issues event: 2
  • Watch event: 23
  • Delete event: 1
  • Issue comment event: 5
  • Push event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 6
  • Fork event: 3
  • Create event: 1
Last Year
  • Issues event: 2
  • Watch event: 23
  • Delete event: 1
  • Issue comment event: 5
  • Push event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 6
  • Fork event: 3
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 445
  • Total Committers: 32
  • Avg Commits per committer: 13.906
  • Development Distribution Score (DDS): 0.312
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
Matthew Perry p****o@g****m 306
Matthew Perry m****y@e****g 45
sgoodm s****n@a****g 14
Matthew Perry m****y@M****l 12
ozak o****k 12
Zeitsperre t****h@l****m 7
Mike Taves m****s@g****m 6
Denis Rykov r****d@g****m 5
Kevin Wurster k****n@s****g 3
Shawn s****r@w****g 3
bcollins p****o@g****m 3
theroggy p****s@g****m 3
Håkon Åmdal h****n@a****m 2
Eric Boucher e****r@g****m 2
Martin Valgur m****r@g****m 2
Nicola Pounder n****r@a****u 2
jeronimol j****l@i****g 2
Gilles Plessis g****s@e****e 2
Chad Hawkins c****h@c****m 1
Graham Jeffries g****s@g****m 1
Jeff j****8@g****m 1
vagrant v****t@p****) 1
Yifan Yu y****y@u****u 1
Jeffrey Gerard j****d@c****m 1
Ibrahim Muhammad i****d@g****m 1
Asger Skovbo Petersen a****r@m****e 1
Malichmal 4****l 1
Paul Hobson p****n@g****m 1
Rasmus Einarsson r****n@g****m 1
Ryan Hodges r****s@g****m 1
and 2 more...

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 71
  • Total pull requests: 53
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 60
  • Total pull request authors: 23
  • Average comments per issue: 2.38
  • Average comments per pull request: 1.6
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 11
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 3
  • Pull request authors: 4
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.55
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • perrygeo (10)
  • lauzadis (2)
  • loicduffar (2)
  • shubhamsharma1609 (1)
  • TimMcCauley (1)
  • Havi-muro (1)
  • engelmannjens (1)
  • bet-bit (1)
  • recoiladam (1)
  • AL89 (1)
  • albantor30 (1)
  • AlexanderJuestel (1)
  • jebouchat (1)
  • cascadet (1)
  • LorenzoBottaccioli (1)
Pull Request Authors
  • perrygeo (18)
  • mwtoews (8)
  • abovzv (2)
  • sgoodm (2)
  • jeronimoluza (2)
  • yyu1 (2)
  • sdtaylor (2)
  • TomKenda (2)
  • groutr (1)
  • Malichmal (1)
  • hawkaa (1)
  • doclements (1)
  • ericboucher (1)
  • diversoft (1)
  • AsgerPetersen (1)
Top Labels
Issue Labels
bug (8) enhancement (6) Needs Additional Info (5) wontfix (2) Packaging (2) invalid (2) question (1) testing (1) documentation (1)
Pull Request Labels
Needs Additional Info (7)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 161,955 last-month
  • Total docker downloads: 2,222
  • Total dependent packages: 42
    (may contain duplicates)
  • Total dependent repositories: 265
    (may contain duplicates)
  • Total versions: 39
  • Total maintainers: 2
pypi.org: rasterstats

Summarize geospatial raster datasets based on vector geometries

  • Versions: 36
  • Dependent Packages: 42
  • Dependent Repositories: 184
  • Downloads: 161,955 Last month
  • Docker Downloads: 2,222
Rankings
Dependent packages count: 0.4%
Dependent repos count: 1.1%
Downloads: 1.3%
Docker downloads count: 1.8%
Average: 1.9%
Stargazers count: 2.8%
Forks count: 4.1%
Maintainers (1)
Last synced: 10 months ago
spack.io: py-rasterstats

rasterstats is a Python module for summarizing geospatial raster datasets based on vector geometries. It includes functions for zonal statistics and interpolated point queries. The command-line interface allows for easy interperability with other GeoJSON tools.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 10.5%
Stargazers count: 11.1%
Average: 19.7%
Dependent packages count: 57.3%
Maintainers (1)
Last synced: 10 months ago
anaconda.org: rasterstats

rasterstats is a Python module for summarizing geospatial raster datasets based on vector geometries. It includes functions for zonal statistics and interpolated point queries. The command-line interface allows for easy interoperability with other GeoJSON tools.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 81
Rankings
Dependent repos count: 20.4%
Average: 35.7%
Dependent packages count: 51.0%
Last synced: 10 months ago

Dependencies

.github/workflows/test-rasterstats.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
requirements.txt pypi
  • affine <3.0
  • click >7.1
  • cligj >=0.4
  • fiona *
  • numpy >=1.9
  • rasterio >=1.0
  • shapely *
  • simplejson *
requirements_dev.txt pypi
  • coverage * development
  • numpydoc * development
  • pytest >=4.6 development
  • pytest-cov * development
  • simplejson * development
  • twine * development