Skip to main content

STAC-geoparquet

Convert STAC items to geoparquet.

Purpose

This library helps convert STAC Items to geoparquet. It might be useful for you if you host a large number of STAC items through a STAC API, but want to provide a bulk API for users who need to access many items.

Usage

stac_geoparquet.to_dataframe does it all. You give it a list of (STAC Item) dictionaries. It just converts them to a geopandas.GeoDataFrame, which can be written to parquet with .to_parquet.

>>> import requests
>>> import stac_geoparquet
>>> item = requests.get("https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ia_m_4209150_sw_15_060_20190828_20191105").json()
>>> df = stac_geoparquet.to_geodataframe([item])
>>> df.to_parquet("naip.parquet")

Note that stac_geoparquet lifts the keys in the item properties up to the top level of the DataFrame, similar to geopandas.GeoDataFrame.from_features.

>>> list(df.columns)
['type',
 'stac_version',
 'stac_extensions',
 'id',
 'geometry',
 'bbox',
 'links',
 'assets',
 'collection',
 'gsd',
 'datetime',
 'naip:year',
 'proj:bbox',
 'proj:epsg',
 'naip:state',
 'proj:shape',
 'proj:transform']

We also provide stac_geoparquet.to_dict and stac_geoparquet.to_item_collection helpers that can be used to convert from DataFrames back to the original STAC items.

pgstac integration

stac_geoparquet.pgstac_reader has some helpers for working with items coming from a pgstac.items table. It takes care of

  • Rehydrating the dehydrated items
  • Partitioning by time
  • Injecting dynamic links and assets from a STAC API

Metadata

Release files for stac-geoparquet 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 stac-geoparquet 0.2.1
File Size Uploaded
stac_geoparquet-0.2.1.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stac-geoparquet 0.2.1
File Interpreter ABI Platform
stac_geoparquet-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / stac_geoparquet-0.2.1.tar.gz

Download URL stac_geoparquet-0.2.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cc6f6a6c61d56811c265d603c9b13bcea65200c5714b5dbf59062a07ffa89289
BLAKE2b-256 checksum
How to use checksums
5c48dab727293077c7093190408687d3379590ab97a17c3f3f6f014ca1e22867
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / stac_geoparquet-0.2.1-py3-none-any.whl

Download URL stac_geoparquet-0.2.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
565155453338ca3ef0d43658b7fb924e1d96409c1ff1bb6a65b3ea0c59717db8
BLAKE2b-256 checksum
How to use checksums
a630d2acfea9c429e76f5e4237b873d12fbb18fdae541742570196d1ad80c797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.3.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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