diff --git a/src/eodash_catalog/utils.py b/src/eodash_catalog/utils.py index caa04847..f7411869 100644 --- a/src/eodash_catalog/utils.py +++ b/src/eodash_catalog/utils.py @@ -636,7 +636,7 @@ def save_items( output_path = f"{buildcatpath}/{colpath}" os.makedirs(output_path, exist_ok=True) parquet_path = f"{output_path}/items.parquet" - stacgp.arrow.to_parquet(table, parquet_path) + stacgp.arrow.to_parquet(table, parquet_path, write_page_index=True) extents = extract_extent_from_geoparquet(table) collection.extent.temporal = extents[0] collection.extent.spatial = extents[1] diff --git a/tests/test_geoparquet.py b/tests/test_geoparquet.py index 9ef5d69a..04136f5e 100644 --- a/tests/test_geoparquet.py +++ b/tests/test_geoparquet.py @@ -58,6 +58,11 @@ def test_geoparquet_geojson_items(catalog_output_folder): ) assert parquet_asset["file:size"] == os.path.getsize(items_path) + # page index lets the client skip pages instead of reading whole column chunks + column = pa.parquet.ParquetFile(items_path).metadata.row_group(0).column(0) + assert column.has_column_index + assert column.has_offset_index + with open(items_path, "rb") as fp: table = pa.parquet.read_table(fp) items = list(stac_gp.arrow.stac_table_to_items(table))