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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
984405299c66b6ede553b327689536441ce12e950b182e99a8c5f733f6471fd5
|
|
| MD5 |
6640bc2dc0e8bc8701e0074162919062
|
|
| BLAKE2b-256 |
078654f39b6f3e41fa01aaa353147d8c1cdd4d55e40a5dd40b7407f2878d9f3c
|
File details
Details for the file stac_geoparquet-0.5.1-py3-none-any.whl.
File metadata
- Download URL: stac_geoparquet-0.5.1-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78c2b9ab047549d05411b1d0663c0b422f6b2ae67f1784d783d7df48f765f2ec
|
|
| MD5 |
3dc0e2c0d8e5f9e2fdbf1b1748b39207
|
|
| BLAKE2b-256 |
d654c67643b6ec1dc5042db1c6c5837247579ba5cf84dbdf196b51637e6e6142
|