{"id":13735878,"url":"https://github.com/perrygeo/python-rasterstats","last_synced_at":"2025-12-12T01:05:21.870Z","repository":{"id":10678332,"uuid":"12916026","full_name":"perrygeo/python-rasterstats","owner":"perrygeo","description":"Summary statistics of geospatial raster datasets based on vector geometries.","archived":false,"fork":false,"pushed_at":"2024-09-27T17:36:32.000Z","size":1114,"stargazers_count":547,"open_issues_count":35,"forks_count":116,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-14T08:54:13.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ga-wolf/WDi14-Homework","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perrygeo.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-18T06:44:29.000Z","updated_at":"2025-05-13T17:14:15.000Z","dependencies_parsed_at":"2023-01-16T21:15:36.192Z","dependency_job_id":"eb05e633-2277-49bd-bc67-7a39f3d6a97c","html_url":"https://github.com/perrygeo/python-rasterstats","commit_stats":{"total_commits":433,"total_committers":31,"mean_commits":13.96774193548387,"dds":0.3163972286374134,"last_synced_commit":"5dac003081e8af906cf60494522f2fd3459d0896"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrygeo%2Fpython-rasterstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrygeo%2Fpython-rasterstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrygeo%2Fpython-rasterstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrygeo%2Fpython-rasterstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perrygeo","download_url":"https://codeload.github.com/perrygeo/python-rasterstats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276446,"owners_count":22043866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:12.456Z","updated_at":"2025-12-12T01:05:21.827Z","avatar_url":"https://github.com/perrygeo.png","language":"Python","funding_links":[],"categories":["`Python` processing of optical imagery (non deep learning)","Python"],"sub_categories":["Python libraries related to EO"],"readme":"rasterstats\n===========\n\n|BuildStatus|_\n\n``rasterstats`` is a Python module for summarizing geospatial raster datasets based on vector geometries.\nIt includes functions for **zonal statistics** and interpolated **point queries**. The command-line interface allows for\neasy interoperability with other GeoJSON tools.\n\nDocumentation\n-------------\nFor details on installation and usage, visit the documentation at `http://pythonhosted.org/rasterstats \u003chttp://pythonhosted.org/rasterstats/\u003e`_.\n\nWhat does it do?\n----------------\nGiven a vector layer and a raster band, calculate the summary statistics of each vector geometry.\nFor example, with a polygon vector layer and a digital elevation model (DEM) raster, compute the\nmean elevation of each polygon.\n\n.. figure:: https://github.com/perrygeo/python-raster-stats/raw/master/docs/img/zones_elevation.png\n   :align: center\n   :alt: zones elevation\n\nCommand Line Quick Start\n------------------------\n\nThe command line interfaces to zonalstats and point_query\nare `rio` subcommands which read and write geojson features\n\n.. code-block:: bash\n\n    $ fio cat polygon.shp | rio zonalstats -r elevation.tif\n\n    $ fio cat points.shp | rio pointquery -r elevation.tif\n\nSee the `CLI Docs \u003chttp://pythonhosted.org/rasterstats/cli.html\u003e`_. for more detail.\n\nPython Quick Start\n------------------\n\nFor zonal statistics\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from rasterstats import zonal_stats\n    \u003e\u003e\u003e stats = zonal_stats(\"tests/data/polygons.shp\", \"tests/data/slope.tif\")\n    \u003e\u003e\u003e stats[0].keys()\n    dict_keys(['min', 'max', 'mean', 'count'])\n    \u003e\u003e\u003e [f['mean'] for f in stats]\n    [14.660084635416666, 56.60576171875]\n\nand for point queries\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from rasterstats import point_query\n    \u003e\u003e\u003e point = {'type': 'Point', 'coordinates': (245309.0, 1000064.0)}\n    \u003e\u003e\u003e point_query(point, \"tests/data/slope.tif\")\n    [74.09817594635244]\n\n\nIssues\n------\n\nFind a bug? Report it via github issues by providing\n\n- a link to download the smallest possible raster and vector dataset necessary to reproduce the error\n- python code or command to reproduce the error\n- information on your environment: versions of python, gdal and numpy and system memory\n\n.. |BuildStatus| image:: https://github.com/perrygeo/python-rasterstats/workflows/Rasterstats%20Python%20package/badge.svg\n.. _BuildStatus: https://github.com/perrygeo/python-rasterstats/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrygeo%2Fpython-rasterstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperrygeo%2Fpython-rasterstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrygeo%2Fpython-rasterstats/lists"}