Skip to main content

rio-stac-io

From Metadata to Pixels

rio-stac-io is a rasterio extension to open STAC Items, ItemCollections, client search results, and STAC-compliant GeoDataFrame tables (e.g. from STAC GeoParquet) using native GDAL drivers including STACIT, STACTA and GTI. The library is build on top of rasterio and pystac. Full notes and a GeoParquet example are in the documentation.

Documentation

https://planetlabs.github.io/rio-stac-io

Installation

pip install rio-stac-io

When using the GTI driver you will need to install gti extras. Your GDAL binaries need to be compiled with geoparquet support.

pip install rio-stac-io[gti]

Usage

from pystac_client import Client

import rio_stac_io as stacio

client = Client.open(...)
search = client.search(...)

with stacio.open(search, asset_key="data") as src:
    data = src.read()

GeoDataFrame input requires pip install rio-stac-io[gti]; rows must follow a STAC item layout (as in stac-geoparquet). The library tries GTI first, then STACIT if GTI is not usable; the use_gti argument is ignored for this input type. Example: read a GeoParquet file, filter rows, then open the asset key:

import geopandas as gpd
import rio_stac_io as stacio

gdf = gpd.read_parquet("items.parquet")
gdf = gdf[gdf["collection"] == "s2"]

with stacio.open(gdf, asset_key="cog") as src:
    data = src.read()

Development

This repository requires Pixi v0.67.2 or later.

git clone git@github.com:planetlabs/rio-stac-io.git
cd rio-stac-io
pixi shell -e dev

Multiple Pixi environments pin different libgdal versions (e.g. dev, dev-gdal310, dev-gdal312, dev-gdal313, dev-gdal311-noparquet; see pyproject.toml for the full list). Rasterio is installed from source ([tool.pixi.pypi-options] no-binary = ["rasterio"]) so it links against the conda GDAL in that environment.

Troubleshooting: rasterio linked to the wrong GDAL

Switching between any two GDAL environments locally (for example moving between any of the dev-gdal* variants) can leave Pixi's PyPI/build cache holding a rasterio build compiled against a different libgdal. Symptoms include odd GTI or CRS failures, or rasterio.__gdal_version__ not matching gdalinfo --version in the same shell.

Check:

pixi run -e <env> verify-gdal

If that fails, clear the cached build and reinstall the environment (not usually needed on CI—runners are isolated per job):

pixi clean cache --pypi --build -y
rm -rf .pixi/envs/<env>
pixi install -e <env>
pixi run -e <env> verify-gdal

Replace <env> with the environment you use (dev, dev-gdal310, dev-gdal312, dev-gdal313, dev-gdal311-noparquet, …).

Metadata

Release files for rio-stac-io 0.4.2

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

Source distribution (sdist)

Source distribution for rio-stac-io 0.4.2
File Size Uploaded Provenance Actions
rio_stac_io-0.4.2.tar.gz 18.1 kB Without provenance Details for rio_stac_io-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rio-stac-io 0.4.2
File Interpreter ABI Platform Actions
rio_stac_io-0.4.2-py3-none-any.whl Python 3 none any Details for rio_stac_io-0.4.2-py3-none-any.whl

Total release size: 37.3 kB

Release files / rio_stac_io-0.4.2.tar.gz

Download URL rio_stac_io-0.4.2.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5397b089b840d5a6fb2ad6058befec568bc480ea4fec5db7690662d0600b0a8b
BLAKE2b-256 checksum
How to use checksums
a1453cd95a99b7f5f750cd51414f6f633b0b4d31653d5b034120ba6eb1edcf29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / rio_stac_io-0.4.2-py3-none-any.whl

Download URL rio_stac_io-0.4.2-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6e8d5438aab766ed2e86d1843973318e3ac9a751e8c977c308dfb0623d78c23
BLAKE2b-256 checksum
How to use checksums
450efb395bb4622f6e93666b52b39a9ca46488d55f7157694d97769f049b7ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for rio-stac-io 0.4.2

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