planetary-computer-sdk-for-python
planetary-computer-sdk-for-python copied to clipboard
Reconstruct STAC Items from geoparquet rows
Apologies if this isn't the right repo to ask this question, but I was looking to reconstruct PySTAC Items from geoparquet rows (https://planetarycomputer.microsoft.com/docs/quickstarts/stac-geoparquet/#Bulk-STAC-item-queries-with-GeoParquet). Is there a convenience method of the flavor item = planetary_computer.item_from_geoparquet_row(dataframe, index) or something similar that I'm not finding? If not, would this be the place to open a PR to add such functionality, or is there a better repo?
I realize iterating over rows of a geopandas dataframe is an antipattern, but I think it's required for my use case (bulk load STAC items, modify them, then write them back out). If there's a better way, any guidance would be appreciated.
Can you try stac_geoparquet.to_item_collection()? https://github.com/TomAugspurger/stac-geoparquet/blob/d2c9ad43e055dda17c1fd30be1d26f082aaaca21/stac_geoparquet/stac_geoparquet.py#L109-L121. That does iterate over rows, but I think it's unavoidable.
Oh, and it's probably buggy, so LMK if you run into issues.
Closing this in favor of issues in stac-geoparquet, primarily https://github.com/TomAugspurger/stac-geoparquet/issues/3.