Skip to main content

No project description provided

Project description

STAC-geoparquet

Convert STAC items to GeoParquet.

Purpose

This library helps convert STAC Items to GeoParquet. While STAC Items are commonly distributed as individual JSON files on object storage or through a STAC API, STAC GeoParquet allows users to access a large number of STAC items in bulk without making repeated HTTP requests.

Usage

Use stac_geoparquet.to_arrow.stac_items_to_arrow and stac_geoparquet.from_arrow.stac_table_to_items to convert between STAC items and Arrow tables. Arrow Tables of STAC items can be written to parquet with stac_geoparquet.to_parquet.to_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.

>>> import requests
>>> import stac_geoparquet.arrow
>>> import pyarrow.parquet

>>> items = requests.get(
...     "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items"
... ).json()["features"]
>>> table = stac_geoparquet.arrow.parse_stac_items_to_arrow(items)
>>> stac_geoparquet.arrow.to_parquet(table, "items.parquet")
>>> table2 = pyarrow.parquet.read_table("items.parquet")
>>> items2 = list(stac_geoparquet.arrow.stac_table_to_items(table2))

See the specification for details on the output stac-geoparquet dataset.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stac_geoparquet-0.5.1.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

stac_geoparquet-0.5.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file stac_geoparquet-0.5.1.tar.gz.

File metadata

  • Download URL: stac_geoparquet-0.5.1.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for stac_geoparquet-0.5.1.tar.gz
Algorithm Hash digest
SHA256 984405299c66b6ede553b327689536441ce12e950b182e99a8c5f733f6471fd5
MD5 6640bc2dc0e8bc8701e0074162919062
BLAKE2b-256 078654f39b6f3e41fa01aaa353147d8c1cdd4d55e40a5dd40b7407f2878d9f3c

See more details on using hashes here.

File details

Details for the file stac_geoparquet-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stac_geoparquet-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78c2b9ab047549d05411b1d0663c0b422f6b2ae67f1784d783d7df48f765f2ec
MD5 3dc0e2c0d8e5f9e2fdbf1b1748b39207
BLAKE2b-256 d654c67643b6ec1dc5042db1c6c5837247579ba5cf84dbdf196b51637e6e6142

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page