Skip to content

Document the __index_level_0__ parquet trick #89

Description

@fmigneault

If a Parquet file is encoded its index happening to be an int64 representation of the DGGS "index", it is possible to configure as such to save space and let pydggsapi do the inline conversion.

    "h3-collection":
      classname: "parquet_collection_provider.ParquetCollectionProvider"
      datasources:
        "h3-collection":
          filepath: "path/to/h3_int64.parquet"
          id_col: __index_level_0__  # "h3"
          data_cols: [...]

By "using the int64 index", I mean as in:

hex_population_canada_df['h3'] = hex_population_canada_df['h3'].apply(lambda zone_id: int(zone_id, 16))

as shown in https://github.com/crim-ca/ogc-dggs/blob/main/canada-population/data_preparation.ipynb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions