Closed TomAugspurger closed 5 months ago
What's the status here, is there a way to convert these geoparqet files to STAC collections (or each row to items) ?
to_item_collection
is the function for that. Depending on how the data was written, you might need to convert some ndarrays to python lists.
OK, Intake 2 now supports reading from these, including multi-banding; but I don't like the format :) Here is my recursive cleaning method.
This is mostly closed by #31
In [1]: import pystac_client, stac_geoparquet
In [2]: items = list(pystac_client.Client.open("https://planetarycomputer.microsoft.com/api/stac/v1").search(collections="aster-l1t", max_items=250).items_as_dicts())
In [3]: df = stac_geoparquet.stac_geoparquet.to_geodataframe(items, dtype_backend="pyarrow")
In [4]: type(stac_geoparquet.to_item_collection(df)[0].to_dict()['stac_extensions'])
Out[4]: list
This currently raises a ValueError:
with
We should verify that all list-likes objects (including those nested within dicts) are lists and not ndarrays.