Skip to content

Alternative DGGRS representations for a given collection #58

@fmigneault

Description

@fmigneault

Currently, the dggrs_zoneid_repr (added in #52, relates to #11) is tightly coupled with the collections[*].collection_provider.

Using the following configuration as example:

dggrs:
  "1":
    IGEO7:
      classname: igeo7_dggrs_provider.IGEO7Provider
  "2":
    ISEA7H-Z7:
      classname: dggal_dggrs_provider.DGGALProvider
      parameters: {"grid": "ISEA7H_Z7"}  # no-op compared to IGEO7Provider, just naming alias for convenience
  "3":
    ISEA7H:
      classname: dggal_dggrs_provider.DGGALProvider
      parameters: {"grid": "ISEA7H_Z7"}  # ideally "ISEA7H", but not currently available in the provider implementation
  "4":
    ISEA7H-HEX:
      classname: igeo7_dggrs_provider.IGEO7Provider  # ??
      parameters: { "dggrs_zoneid_repr": "hex" }  # new property?  not the datasource encoding, but *desired* representation

collections:
  "2":
    manitoba-rcm-ard:
      # ... other metadata ...
      collection_provider:
        providerId: "igeo7-parquet-manitoba-rcm-ard"
        dggrsId: "IGEO7"
        dggrs_zoneid_repr: "textual"  # default
        datasource_id: "igeo7-parquet-manitoba-rcm-ard"

collection_providers:
  "1":
    igeo7-parquet-manitoba-rcm-ard:
      datasources: { "igeo7-parquet-manitoba-rcm-ard": {...} }

Providing the following equivalent endpoints is not possible (unless the DGGRS providers implement a convert() for it):

  • /collections/manitoba-rcm-ard/dggs/IGEO7/...
  • /collections/manitoba-rcm-ard/dggs/ISEA7H/...
  • /collections/manitoba-rcm-ard/dggs/ISEA7H-Z7/...
  • /collections/manitoba-rcm-ard/dggs/ISEA7H-HEX/...

Note

Above are equivalent since only the ZIRS changes, but the underlying DGGH is the same.

Currently, the above would require creating a "duplicate" manitoba-rcm-ard-IGEO7, manitoba-rcm-ard-ISEA7H, etc. collections pointing at their respective datasources with pre-converted zone IDs, since the collections[*].collection_provider.dggrs_zoneid_repr is a tight link. This can potentially consist of a lot of data duplication between the datasources for otherwise easily obtainable ZIRS correspondence. It also makes the "equivalent data" access less obvious to users since different collection IDs would represent the same results, rather than offering the same "collection of data" with different DGGS encodings.

It would make sense to implement dggal_dggrs_provider.DGGALProvider.convert for this case. In general, the int/str representation could always be converted for any DGGRS (via DGGAL), and hex from the int representation. Furthermore, the igeo7_dggrs_provider.IGEO7Provider.convert could handle the specific IGEO7/ISEA7H/ISEA7H-Z7 combination that has an additional case of different str representations (root rhombus vs Z7).


Another limitation of the current configuration structure seems to relate to the 1->1 mapping of collections[*].collection_provider.datasource_id.

If certain DGGRS cannot be easily converted between each other (eg: a hexagonal vs a square DGGRS), but happen to have been pre-processed into distinct collection_providers[*].datasources for corresponding "data", they still cannot be conceptually combined into a single collection ID.

It would be helpful if the global mapping of collections[*].collection_provider allowed multiple entries, for which "conceptual" collection of data can be provided by distinct collection_provider implementations, essentially "abstracting" the multi-provider configuration from the user's perspective accessing this "data concept".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions