rasterio
Fast and direct raster I/O for use with NumPy
What it is and what it does
Rasterio is a Python library for reading and writing geospatial raster data—gridded datasets stored in formats like GeoTIFF that are common in geographic information systems. It wraps GDAL and exposes raster I/O through a NumPy-based API, letting you read bands directly into arrays, inspect metadata like coordinate reference systems and transforms, and write processed data back to disk.
The library is designed for developers working with satellite imagery, digital elevation models, and other gridded geospatial data. It includes a command-line tool (rio) for interactive inspection and format conversion, plus support for plugins to extend functionality. Rasterio 1.5+ requires Python >= 3.12, NumPy >= 2, and GDAL >= 3.8, with official binary packages available for major platforms.
Use it for:
- Read satellite or aerial imagery bands and perform band math (e.g., averaging RGB to create panchromatic data).
- Extract raster data within a georeferenced bounding box or window for regional analysis.
- Convert between raster formats (e.g., GeoTIFF to netCDF) with coordinate system and compression control.
- Inspect and validate raster metadata (CRS, transform, band count) before processing.
- Write processed NumPy arrays back to georeferenced raster files with custom compression and data types.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Rasterio reads and writes geospatial raster data in formats like GeoTIFF, providing a Python API based on N-D arrays for working with gridded datasets.
Yes. Rasterio is actively maintained, production-stable, has no known vulnerabilities, and is the standard Python interface for raster I/O in geospatial workflows. Medium install friction is manageable given the availability of official binary wheels. Install if you work with gridded geospatial data.
Install
rasterio on PyPI
pip
pip install rasteriouv
uv add rasteriopoetry
poetry add rasterioInstalling rasterio
Before you install
Medium install friction due to compiled C/Cython dependencies and GDAL requirements, but official binary wheels are available for Linux, macOS, and Windows. Active maintenance with a recent release (6 days old) and 2560 repository stars indicate solid ongoing support.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute rasterio freely in commercial and open-source projects with minimal restrictions.
Quickstart
import rasterio
import numpy as np
with rasterio.open('input.tif') as src:
data = src.read()
profile = src.profile
with rasterio.open('output.tif', 'w', **profile) as dst:
dst.write(data)
Requires Python >= 3.12, NumPy >= 2, and GDAL >= 3.8; GDAL system library must be installed or available via binary wheels.
Verify before relying
- Whether the HDF5, netCDF, and OpenJPEG2000 drivers mentioned are included in all PyPI binary wheels or only some platforms.
- Performance characteristics for very large raster files or streaming workflows.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 6 — affine, attrs, certifi, click, numpy, pyparsing |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,654,386/month — #1,513 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rasterio-1.5.1-cp312-cp312-macosx_14_0_arm64.whl; rasterio-1.5.1-cp312-cp312-macosx_15_0_x86_64.whl; rasterio-1.5.1-cp312-cp312-manylinux_2_28_aarch64.whl; rasterio-1.5.1-cp312-cp312-manylinux_2_28_x86_64.whl; rasterio-1.5.1-cp312-cp312-win_amd64.whl; rasterio-1.5.1-cp312-cp312-win_arm64.whl; rasterio-1.5.1-cp313-cp313-macosx_14_0_arm64.whl; rasterio-1.5.1-cp313-cp313-macosx_15_0_x86_64.whl; rasterio-1.5.1-cp313-cp313-manylinux_2_28_aarch64.whl; rasterio-1.5.1-cp313-cp313-manylinux_2_28_x86_64.whl; rasterio-1.5.1-cp313-cp313-win_amd64.whl; rasterio-1.5.1-cp313-cp313-win_arm64.whl; rasterio-1.5.1-cp314-cp314-macosx_14_0_arm64.whl; rasterio-1.5.1-cp314-cp314-macosx_15_0_x86_64.whl; rasterio-1.5.1-cp314-cp314-manylinux_2_28_aarch64.whl; rasterio-1.5.1-cp314-cp314-manylinux_2_28_x86_64.whl; rasterio-1.5.1-cp314-cp314t-macosx_14_0_arm64.whl; rasterio-1.5.1-cp314-cp314t-macosx_15_0_x86_64.whl; rasterio-1.5.1-cp314-cp314t-manylinux_2_28_aarch64.whl; rasterio-1.5.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Keywords: gis, raster, gdal
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
color-operationsApplies color-oriented image operations—gamma…
permissive · top 15,000 on PyPI
rio-tilerrio-tiler reads raster data from local and…
permissive · top 15,000 on PyPI
rasterstatsRasterstats computes summary statistics (mean,…
permissive · top 15,000 on PyPI
xarray-spatialxarray-spatial provides 150+ functions for…
permissive · top 15,000 on PyPI
rioxarrayrioxarray extends xarray with geospatial and…
permissive · top 5,000 on PyPI
rio-cogeorio-cogeo creates and validates Cloud Optimized…
permissive · top 15,000 on PyPI
fionaFiona reads and writes vector GIS data…
permissive · top 5,000 on PyPI
rasterixRasterix provides tools for analyzing raster…
permissive · top 15,000 on PyPI
exactextractexactextract computes zonal statistics—fast…
permissive · top 15,000 on PyPI
pylercpylerc encodes and decodes raster image data…
permissive · top 15,000 on PyPI