CartoDB / deck.gl-examples

6 stars 4 forks source link

Spatial Index H3 example #3

Closed menusal closed 1 year ago

menusal commented 1 year ago

Description

We will use the following h3 dataset at resolucion 8: cartobq.public_account.derived_spatialfeatures_usa_h3int_res8_v1_yearly_v2

It's a dataset of 12M rows and 13.1GB of data.

We will show how we can run dynamic queries in real-time with a query as follows:

select h3, {variable} cartobq.public_account.derived_spatialfeatures_usa_h3int_res8_v1_yearly_v2
where {variable} between {@min_value} and {@max_value}

The list of variables is available at: https://public.carto.com/api/v4/data/observatory/metadata/datasets/cdb_spatial_fea_94e6b1f/variables?minimal=true. We will only display float variables and we will show the name and the description of the variable in the UI.

All the filtering should run server side

Interactivity as hover is requrired to show: hexid + variable

Shorcut: sc-361044

CHECKLIST

TODO

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to:

menusal commented 1 year ago

Discussion about filtering

The filter at the highest aggregation number (maximum zoom) is well understood. The problem conceptually comes at the aggregation level. When we zoom out, since there is an aggregation expression SUM(<field>), the filters are acting at the single cell level and do not take into account the aggregation aggregationExp and paint cells, which visually the user would expect not to see since they are adding the values that contain the filter.

image

I'd like you to please watch the video attached in the description.