terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

Join tabular and vector data sources (client-side region mapping)

Open nf-s opened this issue 11 months ago • 3 comments

It would be great to be able to join tabular datasets with vector datasets by column.

This would present data in a similar way to region mapping - where we "join" tabular dataset with vector tile datasets.

For example

  • GeoJSON of City of Melbourne CLUE blocks - https://data.melbourne.vic.gov.au/api/explore/v2.1/catalog/datasets/blocks-for-census-of-land-use-and-employment-clue/exports/geojson?lang=en&timezone=Australia%2FSydney (is 300KB)
  • CSV of jobs in Melbourne by type by CLUE Block - https://data.melbourne.vic.gov.au/api/explore/v2.1/catalog/datasets/employment-by-block-by-anzsic/exports/csv?lang=en&timezone=Australia%2FSydney&use_labels=true&delimiter=%2C (is 700KB)

We would join by "Block ID"

nf-s avatar Sep 20 '23 12:09 nf-s

This would be cool

  • Create a new vector-join catalog item - which extends GeoJsonMixin
  • Add members property that allows you to define catalog items to merge
    • These can be GeoJsonMixin or TableMixin catalog items
    • Or, IDs to existing models (in the catalog)
  • Have some sort of joinBy trait
  • Merge all the rows/features into a new GeoJson Feature collection
  • That's it

This means you can use any tabular or geojson source to merge - for example

  • Opendatasoft table
  • GeoJSON polygons

Or

  • CSV time-series
  • ArcGis FeatureService

It also means you don't need to modify TableMixin or GeoJsonMixin

nf-s avatar Oct 04 '23 03:10 nf-s

@steve9164 to link old PR

nf-s avatar Oct 25 '23 03:10 nf-s

See https://github.com/TerriaJS/terriajs/pull/3963

You're right about old. This PR is built on terriajs 7.

steve9164 avatar Oct 29 '23 14:10 steve9164