Enrichment of catchment areas for store characterization

Intermediate difficulty banner

Requirements

To run this example you'll need:

  • The latest version of the Analytics Toolbox Core Native App installed in your Snowflake database

  • Optional: An active CARTO organization to visualize the results in a map

Prefer a low-code approach? Check out our Workflows templates for Data Enrichment.

Example

In this example we are going to characterize all Starbucks locations in the US by the total population covered by their catchment areas. We are going to define these catchment areas as a 3km buffer around each store.

First, let’s start by visualizing all Starbucks locations in the US.

To quickly explore this data, using the Analytics Toolbox, we can easily compute an aggregation of these locations using Quadkeys at resolution 15, which lets us visualize the result as a heatmap. Here is a close-up of the Manhattan area, where we can easily identify the areas of highest concentration of Starbucks stores.

Now, let’s enhance our analysis by computing a 3 km buffer around each store, using the geometry constructor module from the Analytics Toolbox:

We can then deepen our analysis by computing the Quadkeys at resolution 15 that intersect with these buffers using the available polyfill function.

Next, we enrich the resulting Quadkeys with the total population and the population by gender using CARTO’s Spatial Features dataset, available for free in the Snowflake Data Marketplace. Since this dataset is already delivered in Quadkeys at resolution 15, enrichment can be performed by a simple JOIN.

By zooming into a particular area we can see the distribution of the total population (where darker colors represent higher population levels).

Once we have this data ready, we can now calculate the total population that is within a 3km radius from each store location. This catchment analysis can be performed from start to finish with the following query:

The result is a beautiful map visualization, where each Starbucks location is represented by a point and whose catchment is proportional to the total population within a 3km radius:

Last updated

Was this helpful?