Builds CARTO workflows for site selection and cannibalization analysis. Scores and ranks candidate locations, quantifies overlap between trade areas, and finds twin areas similar to top-performing locations.
Ships in carto-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Builds CARTO Workflows that identify optimal locations for new facilities (stores, stations, offices) by combining spatial criteria, and that quantify cannibalization risk from overlapping catchment areas.
Prerequisites: Load carto-create-workflow for the development process, JSON structure, and validation. It covers both access paths — the MCP server's workflow tools (create_workflow, validate_workflow, run_workflow) when attached, the carto workflows CLI otherwise. Routing signals: carto-basics/references/access-paths.md. Load carto-trade-area-analysis if the workflow involves isochrones, buffers, or catchment enrichment — it covers the catchment pipeline in detail.
| User intent | Pattern |
|---|---|
| "Where should I open a new store?" | Site Selection (scoring + ranking) |
| "Will a new store hurt existing ones?" | Cannibalization Analysis |
| "Find locations similar to my best performers" | Twin Areas: no native component; offer the Pattern C approximation |
Existing locations + Target area -> Spatial indexing -> Enrich with demographics/POIs -> Score/Rank -> Filter top candidates -> Save
Load each table as a ReadTable source node (see carto-create-workflow). Source nodes and native.gettablebyname both emit on handle out, not result.
Splitting candidates from existing network when both sit in one table. If the user's source is a single table where "candidates" are defined by a numeric threshold (e.g. revenue ≥ X, size ≥ Y), use one native.where with that predicate and wire its match output to the candidate pipeline and its unmatch output to the existing-network pipeline. Two streams from one node — dramatically cleaner than orderby + limit + customsql NOT IN, and avoids a customsql entirely. The threshold approximates "top N"; if the user explicitly says "exactly top 25", orderby + limit is still the right call but pay the extra-node cost knowingly.
Success: Both tables loaded with geometry columns and unique identifiers.
Polyfill the target area into H3 or Quadbin cells using native.h3polyfill or native.quadbinpolyfill. Each cell is a candidate micro-location.
Set resolution explicitly. H3 8 (edge ≈ 0.53 km, ≈ 0.74 km²) for drive-time or city-wide screening; H3 9 (≈ 0.20 km, ≈ 0.11 km²) for walkable urban siting. Quadbin 15 (≈ 1.2 km wide at the equator, narrower toward the poles) to 17 (≈ 0.3 km). Never leave native.quadbinpolyfill at its default 12 (≈ 10 km cells). If you will enrich by joining an indexed table, use that table's resolution.
Success: A contiguous grid of cells covering the study area.
Attach demand signals (population, income, foot traffic, POI density) with native.h3enrich (H3 grid) or native.quadbinenrich (Quadbin grid), whose source can be any table with a geometry column or a Data Observatory subscription; or with native.joinv2 on the cell column against a table indexed at the same resolution.
If candidates are continuous polygons (catchments / districts) rather than a grid, the choice between native.enrichpolygons and native.spatialjoin + native.groupby matters — see carto-spatial-enrichment Step 4 for the trade-off (AT dependency vs node count vs predicate / join control).
Success: Each grid cell has numeric columns representing demand/suitability factors.
native.h3distance compares two H3 columns of the same row; it does not search another table. For each candidate cell's hop distance to the nearest existing location:
native.h3frompoint on the existing locations, at the grid's resolution (adds h3).native.crossjoin: maintable = candidate grid, secondarytable = location cells. Secondary columns get a _joined suffix, so the location cell is h3_joined. On Databricks cluster connections native.crossjoin prefixes every column with l_ / r_ instead (e.g. l_h3, r_h3). It yields cells x locations rows, so filter the grid first.native.h3distance: h3_1 = h3, h3_2 = h3_joined (adds h3_distance).native.groupby: columns = h3_distance,min, groupby = h3 (gives h3_distance_min).native.joinv2 back to the enriched grid on h3, then native.where on h3_distance_min to drop cells too close (cannibalization risk) or too far (logistics cost). It is a hop count, not metric distance (see Gotchas).Distance semantics — measure cannibalization from the catchment polygon, not the candidate point. When candidates are points with a generated trade area (isoline / buffer — see carto-trade-area-analysis), run native.distance with main = the candidates' catchment polygons (geom after native.isolines, <geo>_buffer after native.buffer) and secondary = the existing locations. ST_DISTANCE(polygon, point) = 0 whenever the competitor sits inside the trade area — exactly the cannibalization signal you want; point-to-point distance hides overlap. Set radius (units Meters by default) to the farthest distance at which a competitor still matters, about the catchment's own reach (~800 m for a 10-minute walk). radius is a cutoff: it does not change nearest_distance, and candidates with no competitor inside it are dropped from the output. To keep them, native.joinv2 (jointype Left) from the full candidate list on the id, and read a NULL nearest_distance as no competitor within radius. This polygon-to-point pattern is the middle ground between Pattern A's H3 hop filter and Pattern B's full grid-overlap analysis — use it whenever the candidate already has a continuous catchment geometry.
Success: Candidate cells are within a sensible distance band from existing locations, and any cannibalization signal is measured from the catchment polygon when one exists.
Use the scoring pattern from trade-area-analysis:
native.normalize node (one column per node). It adds <column>_norm (0-1; z-score with zscores: true); the score expression must use those names.native.selectexpression with user-defined weightsnative.orderby (desc: true; the default is ascending) + native.limit (top N)Success: A ranked shortlist of candidate cells with composite scores and contributing variables.
Use native.saveastable. The H3/Quadbin column is directly visualizable in CARTO Builder.
Success: Validated workflow ready to upload.
Existing + Proposed locations -> Trade areas (isoline/buffer) -> Polyfill to grid -> Intersect/Join -> Measure overlap -> Save
Load existing locations and proposed locations (or a single table with a flag column distinguishing them). If both sets sit in a single table and the split is defined by a numeric threshold (e.g. revenue ≥ X), see Pattern A Step 1's native.where match/unmatch split — it produces both streams from one node and avoids customsql.
Success: Both sets loaded with geometry and unique identifiers.
Create catchment areas around both existing and proposed locations using native.isolines (realistic) or native.buffer (simple). Use the same parameters for both sets to ensure comparability.
Success: Every location has a catchment polygon with consistent parameters.
Polyfill each catchment set with native.h3polyfill (or native.quadbinpolyfill), same resolution for both. Set geo to the catchment polygon: geom after native.isolines, <geo>_buffer (e.g. geom_buffer) after native.buffer; polyfilling the point column gives one cell per location.
aggregate false (default) so the location id is kept.aggregate: true returns the distinct cells of all proposed catchments, so a cell shared by two proposed sites counts once. Keep aggregate false only if the user also wants impact per proposed site.Success: One row per cell per existing location, and the cells covered by proposed catchments.
Use native.joinv2 (jointype Inner, on the cell column) between existing-location cells and proposed-location cells. The result contains the existing-catchment cells that a proposed catchment also covers.
Success: Output contains only cells that fall in both an existing and a proposed catchment.
Per existing location:
native.groupby on the existing-location cells: columns = h3,count, groupby = the location id (total cells).native.groupby on the overlap join: same columns and groupby (overlapping cells). With per-proposed-site cells, also group by the proposed id.native.joinv2 with jointype Left from totals to overlap on the id, so locations with no overlap stay in.native.selectexpression: COALESCE(<overlap count>, 0) * 1.0 / <total count> as overlap_pct (* 1.0 avoids integer division on PostgreSQL and Redshift).To quantify shared demand, enrich the overlap cells with population or revenue before step 2 and sum it.
Success: Each existing location has an overlap metric showing how much of its catchment is shared with proposed locations.
Use native.saveastable.
Success: Validated workflow with per-location cannibalization metrics.
Workflows has no twin-areas or similar-locations component on any connection. Do not invent one or name an Analytics Toolbox procedure for it. Tell the user so, then offer this approximation and build it only if they agree:
native.where on revenue, or native.orderby desc: true + native.limit).carto-trade-area-analysis).native.groupby with <col>,avg) to find the variables where they stand out.carto-composite-scoring), then rank and save.Success: A ranked list of candidate areas, described to the user as a weighted score on the variables that set top performers apart, not a similarity model.
For demand-driven site selection (e.g. "where is unmet demand highest?") on BigQuery, Snowflake or Databricks, use native.commercialhotspots (combined Getis-Ord Gi* over several weighted variables; working example: carto-trade-area-analysis/commercial_hotspots.json):
h3, quadbin, index or geoid.weights.native.commercialhotspots with indexcol = the cell column, weights (see Note), kring (default 3) and pvaluethresh (default 0.05). Cells above pvaluethresh are already dropped, so no filter node is needed. On Databricks cluster connections also set kernel and clustertype (hotspots, coldspots or all): that path has no defaults and the run fails without them.index on BigQuery), combined_gi and p_value. Join it back to the enriched grid on the cell column to keep the other variables.Note: there is no variablecolumns input. weights is a JSON-encoded string of [column, weight, reverse] triples, e.g. [["population_sum", 0.7, false], ["h3_distance_min", 0.3, false]]. Weights are normalized to sum to 1; reverse: true flips a variable where lower is better.
h3, is_proposed, population, etc.) — BigQuery / Databricks / Postgres / Redshift convention. On Snowflake, unquoted identifiers surface UPPERCASE — reference them as H3, IS_PROPOSED, POPULATION. See carto-create-workflow/references/providers/<provider>.md for casing rules and SQL dialect equivalents.native.isolines, native.h3enrich, native.quadbinenrich or native.enrichpolygons: use native.buffer and native.joinv2 against an indexed table. native.distance runs only on BigQuery, Snowflake, Redshift and PostgreSQL. native.commercialhotspots runs only on BigQuery, Snowflake and Databricks.native.commercialhotspots runs Analytics Toolbox procedures. The component catalog lists it on those connections whether or not the toolbox is installed, and neither validate nor verify probes the procedure; a missing toolbox only shows when the workflow runs.native.h3distance returns hop count, not metric distance. One hop is about 1.5-1.7 x the cell edge (centre to centre): ≈ 2.1-2.4 km at res 7 (edge ≈ 1.4 km), ≈ 0.8-0.9 km at res 8 (edge ≈ 0.53 km), ≈ 0.30-0.35 km at res 9 (edge ≈ 0.20 km).| Tutorial | Provider | URL |
|---|---|---|
| Pizza Hut Honolulu — site selection with commercial hotspots | BigQuery | Link |
| Pizza Hut Honolulu — site selection with commercial hotspots | Snowflake | Link |
| Store cannibalization — quantifying new store impact | BigQuery | Link |
| Starbucks cannibalization — H3 grid overlap analysis | BigQuery | Link |
| Store cannibalization — Quadkey grid overlap | Snowflake | Link |
| Find twin areas of top-performing stores | BigQuery | Link |
| Find similar locations based on trade areas | BigQuery | Link |
| EV charging station site selection | Workflows | Link |
| Variant | How |
|---|---|
| Retail expansion | Isochrones -> enrich with demographics + competitor density -> composite score -> top N |
| Franchise territory planning | Cannibalization pattern to ensure non-overlapping catchments before awarding territories |
| EV charging / public services | Grid-based demand (population, traffic) + distance-from-existing filter -> rank underserved cells |
| Billboard / OOH placement | Buffers -> audience enrichment -> normalize + weight -> top N (see trade-area-analysis) |
| Bank branch optimization | Score candidate cells on the variables that distinguish top branches, then rank (Pattern A) |
| Competitor proximity analysis | native.h3frompoint on competitors -> native.crossjoin with the grid -> native.h3distance -> native.groupby h3_distance,min by h3 -> keep cells far from competitors but near demand |
What SKILL.md sets; muted values are Claude Code's defaults
24 skills in this plugin
/carto-arcgis-migrationEnd-to-end ArcGIS Portal / AGOL → CARTO migration. Triggers when the user wants to migrate ArcGIS content to CARTO, plan a migration, asks "what's in my Portal", names a Portal/AGOL URL, or asks to migrate the datasets / web maps / simple apps. Runs three phases — discover (enumerate items + write MIGRATION_MANIFEST.md), migrate-data (Hosted Feature Layers / Tables → CARTO tables), migrate-maps (Web Maps + simple Dashboards / Web Experiences / Web Mapping Apps → CARTO Builder maps). Default mode is batch; migrated maps are always tagged `From ArcGIS` and created as private./carto-basicsStart here for first-time CARTO use. Orients on the two parallel access paths into the CARTO platform — the MCP server (the primary path for inline, in-conversation work in chat hosts, including creating and editing maps and Workflows) and the CLI (for scripting, CI/CD, headless and bulk/cross-org work, and deeper administration and auditing such as usage-log queries) — and which skills cover each. Also covers CLI install, authentication, profiles, JSON output, and async job patterns./carto-composite-scoringGuides the user through building composite score workflows when they ask about composite scores, indexes, multi-variable scores, ranking areas, site scoring, market potential, resilience indexes, risk indexes, weighted scores, PCA, or supervised/unsupervised scoring./carto-skills:carto-site-selectionfrom carto-skills
npx claudepluginhub cartodb/agent-skills --plugin carto-skillsOther plugins' skills for the same job