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.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 rio-stac-io 0.4.1
File Size Uploaded Provenance Actions
rio_stac_io-0.4.1.tar.gz 17.2 kB Without provenance Details for rio_stac_io-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 35.6 kB

Release files / rio_stac_io-0.4.1.tar.gz

Download URL rio_stac_io-0.4.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dd4219f2e6e04838a6297ffc2284903543d0dae704425db21d603913ce8d1a90
BLAKE2b-256 checksum
How to use checksums
2ee03c4ed9aca761de0c09d454a0c8d8b543bb41a58f55d973db45ba1a4d46d6
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.1-py3-none-any.whl

Download URL rio_stac_io-0.4.1-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
165166c76a867e24fb7686978f11b25668d9410aaec11edd1d897d4feacd2db1
BLAKE2b-256 checksum
How to use checksums
4fff3c94cb6dfa8438c9dfe04492d29f058be62692ba5272eb87ab1c91a2cb0f
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.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