Spatial Indexes

Components to operate with spatial indexes: H3 and Quadbin. Learn more about how to leverage spatial indexes in your analyses.

H3 Boundary

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component takes a table with H3 cell indices and generates a new one with an additional column containing the boundaries of those H3 cells.

Inputs

  • Source table [Table]

  • H3 column [Column]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

H3 Center

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component adds a new column containing the centers of H3 cells.

Inputs

  • Source table [Table]

  • H3 column [Column]

Outputs

  • Result table [Table]:

External links

BigQuery reference

H3 Grid Distance

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component computes the H3 grid distance between two H3 index columns, creating a new table with the same columns as the source one and adding a new 'h3_distance' column.

The H3 distance is defined as the length of the shortest path between the cells in the graph formed by connecting adjacent cells.

This function will return 'null' if the cells are too far apart to compute the distance.

Inputs

  • Source table [Table]

  • First H3 index column [Column]

  • Second H3 index column [Column]

Outputs

  • Result table [Table]:

External links

BigQuery reference

H3 from GeoPoint

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component adds a new column containing the indices of H3 cells corresponding to points.

Inputs

  • Source table [Table]

  • Points column [Column]

  • Resolution [Number]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

H3 KRing

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

Returns the neighboring indexes in all directions under the K distance size.

Inputs

  • Source table [Table]

  • H3 index [Column]

  • Size [Number]

  • Include distance [Boolean]: add or not column with the value of H3 distance

  • Include columns [Boolean]: copy or not source columns in the result table

Outputs

  • Result table [Table]:

External links

BigQuery reference

Snowflake reference

Postgres reference

H3 Polyfill

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This generates a table with indices of all H3 cells included within a given extent for a given resolution.

The extent is specified using a table with polygons.

Inputs

  • Source table [Table]

  • Geo column [Column]

  • Resolution [Number]

  • Keep input table columns: If checked, all the original columns of the source table will be added to the result table. Otherwise, only columns with the geometry and the H3 index will be added.

  • Mode:

    • Center:Returns only the cells which centroid intersects with the input features.

    • Intersects:Returns all cells that intersect with the input features.

    • Contains:Returns only the cells that are entirely contained within the input features.

Outputs

  • Result table [Table]:

External links

BigQuery reference

Snowflake reference

Postgres reference

H3 To Parent

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

Adds a new column named h3_parent with the value of the parent h3 at a specific resolution. If required resolution is higher than h3 column, a null value will be set.

Inputs

  • Source table [Table]

  • H3 index [Column]

  • Resolution [Number]

Outputs

  • Result table [Table]:

External links

BigQuery reference

Snowflake reference

Postgres reference

Quadbin Boundary

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component takes a table with Quadbin cell indices and generates a new one with an additional column containing the boundaries of those Quadbin cells.

Inputs

  • Source table [Table]

  • Quadbin column [Column]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Quadbin Center

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component adds a new column containing the centers of Quadbin cells.

Inputs

  • Source table [Table]

  • Quadbin column [Column]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Quadbin from GeoPoint

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This component adds a new column containing the indices of Quadbin cells corresponding to points.

Inputs

  • Source table [Table]

  • Points column [Column]

  • Resolution [Number]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Quadbin Kring

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

Returns all Quadbin cell indexes and their distances in a filled square k-ring of a user defined size centered at the origin in no particular order.

Inputs

  • Source table [Table]

  • Quadbin index [Column]

  • Size [Number]

  • Include distance [Boolean]: add or not column with the value of Quadbin distance

  • Include columns [Boolean]: copy or not source columns in the result table

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Quadbin Polyfill

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

This generates a table with indices of all Quadbin cells included within a given extent for a given resolution.

The extent is specified using a table with polygons.

Inputs

  • Source table [Table]

  • Geo column [Column]

  • Resolution [Number]

  • Mode:

    • Center:Returns only the cells which centroid intersects with the input features.

    • Intersects:Returns all cells that intersect with the input features.

    • Contains:Returns only the cells that are entirely contained within the input features.

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Quadbin To Parent

This component requires the CARTO Analytics Toolbox installed in the chosen connection to build the workflow.

Description

It adds a new column named quadbin_parent with the value of the parent quadbin at a specific resolution. If required resolution is higher than quadbin column, than an "Invalid resolution" query error will be returned.

Inputs

  • Source table [Table]

  • Quadbin index [Column]

  • Resolution [Number]

Outputs

  • Result table [Table]

External links

BigQuery reference

Snowflake reference

Redshift reference

PostgreSQL reference

Last updated