Skip to main content

Raster To DataFrame

PyPI Status Build Status Documentation Status Coverage Status

A simple python module that converts a raster to a Pandas DataFrame.

from rastertodataframe import raster_to_dataframe

raster_path = '/some/gdal/compatible/file.tif'
vector_path = '/some/ogr/compatible/file.geojson'

# Extract all image pixels (no vector).
df = raster_to_dataframe(raster_path)

# Extract only pixels the vector touches and include the vector metadata.
df = raster_to_dataframe(raster_path, vector_path=vector_path)

Features

  • Convert any GDAL compatible raster to a Pandas DataFrame.

  • Optionally, if any OGR compatible vector file is given, only pixels touched by the vector are extracted from the raster. The output DataFrame includes these pixels as well as any attributes from the vector file.

Installation

pip install rastertodataframe
  • A working GDAL/OGR installation is required. This is best accomplished with conda.

conda install -c conda-forge numpy gdal geopandas pandas pyproj

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.2.1 (2019-02-13)

  • Add support for single band rasters.

0.2.0 (2018-07-12)

  • Implement tiling to reduce memory use for large rasters.

0.1.3 (2018-07-09)

  • Remove dependencies to fix non-building installs.

0.1.2 (2018-07-09)

  • Fix creation of temporary files on windows.

0.1.1 (2018-07-08)

  • All logic implement with unit tests. Prepare for PyPI release.

0.1.0 (2018-07-07)

  • Project started.

Metadata

Release files for rastertodataframe 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rastertodataframe 0.2.1
File Size Uploaded Provenance Actions
rastertodataframe-0.2.1.tar.gz 39.6 kB Without provenance Details for rastertodataframe-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rastertodataframe 0.2.1
File Interpreter ABI Platform Actions
rastertodataframe-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for rastertodataframe-0.2.1-py2.py3-none-any.whl

Total release size: 47.0 kB

Release files / rastertodataframe-0.2.1.tar.gz

Download URL rastertodataframe-0.2.1.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f5b6b5ab24db79f3b79501946b4a43d452be3b0b3c41ffa491b48f9d34f93350
BLAKE2b-256 checksum
How to use checksums
3c7bc9fefc63e489d9e1b9692bc2dc3d15cd49a5122960c7d9b8dcbb7d4383b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

Release files / rastertodataframe-0.2.1-py2.py3-none-any.whl

Download URL rastertodataframe-0.2.1-py2.py3-none-any.whl
Size 7.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
41d1eb6756b8dcdb0ffe33bf45a7f7e1aff89f52a8c599e1b2a671bec9e5003d
BLAKE2b-256 checksum
How to use checksums
747126194dbc50be44dc19cdcf100e21f535e8fc6f8ab3d7b86e04379026d00d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

Security for rastertodataframe 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page