.cortex/skills/retail-catchment/SKILL.md
Deploy the Retail Catchment Analysis demo with Overture Maps data. Use when: setting up retail catchment demo, deploying catchment analysis, creating retail location analysis app, retail isochrone analysis, competitor mapping demo. Do NOT use for: fleet intelligence demos (use fleet-intelligence-taxis or fleet-intelligence-food-delivery), route optimization (use route-optimization), route deviation analysis (use route-deviation), or dwell analysis (use dwell-analysis). Triggers: retail demo catchment, deploy retail catchment demo, retail isochrone analysis, competitor mapping demo, retail location analysis, trade area analysis.
npx skillsauth add snowflake-labs/sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator retail-catchmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploy the Retail Catchment Analysis demo that visualizes trade areas, competitors, and address density using OpenRouteService isochrones and Overture Maps data. Dashboard pages are served via the shared React Demo Dashboard app.
| Parameter | Default | Description |
|-----------|---------|-------------|
| DATABASE | FLEET_INTELLIGENCE | Target database for all objects |
| SCHEMA | RETAIL_CATCHMENT | Schema for retail analysis tables |
| WAREHOUSE | ROUTING_ANALYTICS | Warehouse for queries and data loading |
OPENROUTESERVICE_NATIVE_APP)| Privilege | Scope | Reason | |-----------|-------|--------| | CREATE DATABASE | Account | Creates FLEET_INTELLIGENCE database | | CREATE WAREHOUSE | Account | Creates ROUTING_ANALYTICS warehouse | | IMPORT SHARE | Account | Acquires OVERTURE_MAPS__PLACES and OVERTURE_MAPS__ADDRESSES from Marketplace | | USAGE ON DATABASE FLEET_INTELLIGENCE | Database | Uses the setup database | | CREATE SCHEMA | Database (FLEET_INTELLIGENCE) | Creates RETAIL_CATCHMENT schema | | CREATE TABLE | Schema (FLEET_INTELLIGENCE.RETAIL_CATCHMENT) | Creates CONFIG, RETAIL_POIS, CITIES_BY_STATE, REGIONAL_ADDRESSES, REGION_CONFIG | | USAGE ON DATABASE OVERTURE_MAPS__PLACES | Database | Reads Marketplace POI data | | USAGE ON DATABASE OVERTURE_MAPS__ADDRESSES | Database | Reads Marketplace address data | | USAGE ON DATABASE OPENROUTESERVICE_NATIVE_APP | Database | Calls ORS isochrone functions |
Note: ACCOUNTADMIN is NOT required. Create a custom role with the above privileges, or use any role that has them.
Follow the Error Logging convention in AGENTS.md. Log file prefix:
retail-catchment.
snowflake_sql_execute tool call.SET session variables.Quick deploy: Run references/seed-data.sql via
snow sql -fto execute Steps 4-5 in one shot. Edit the SET variables at the top to customize for your region.Full SQL with step-by-step explanations: references/sql-pipeline.md All CREATE statements in the referenced SQL include COMMENT tracking tags per AGENTS.md convention (
"origin":"sf_sit-is-fleet","name":"oss-retail-catchment").
Pre-check: If data already exists, skip to Step 6. Run:
SELECT COUNT(*) AS cnt FROM FLEET_INTELLIGENCE.RETAIL_CATCHMENT.RETAIL_POIS;
If cnt > 0, the data pipeline has already run. Skip to Step 6 (Verify) as needed.
Goal: Set session query tag for attribution tracking.
See
references/sql-pipeline.mdStep 1.
Goal: Confirm OpenRouteService Native App is installed and services are running.
STOP if ORS is not installed. Direct user to build-routing-solution skill.
See
references/sql-pipeline.mdStep 2.
Goal: Acquire Overture Maps Places and Addresses datasets for POI and density data.
See
references/sql-pipeline.mdStep 3.
Goal: Set up the demo database, schema, warehouse, and CONFIG table.
See
references/sql-pipeline.mdStep 4.
Output: Database FLEET_INTELLIGENCE, schema RETAIL_CATCHMENT created with CONFIG table.
Goal: Create pre-filtered, performance-optimized tables from Overture Maps marketplace data.
Important: Step 5 uses SQL session variables (
SET REGION_KEY,SET BBOX_*). Execute all Step 5 sub-steps in a single session (e.g., viasnow sql -f) or prepend the SET statements to each sub-step's SQL block when usingsnowflake_sql_execute.
RETAIL_POIS)CITIES_BY_STATE)REGIONAL_ADDRESSES)REGION_CONFIG)STOP if any table has 0 rows. Check bounding box config and Marketplace access.
See
references/sql-pipeline.mdStep 5.
Goal: Confirm data tables exist and have rows.
See
references/sql-pipeline.mdStep 8.
The React Demo Dashboard page queries these exact tables and columns. If the pipeline changes column names, the React page must be updated to match.
| Column | Type | Used By | |--------|------|---------| | VEHICLE_TYPE | VARCHAR | Global vehicle type selector | | REGION | VARCHAR | Global region selector (updated by server on region switch) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RetailCatchment (region filter) | | POI_ID | VARCHAR | RetailCatchment (store selection, competitor filter) | | POI_NAME | VARCHAR | RetailCatchment (store dropdown, metrics) | | BASIC_CATEGORY | VARCHAR | RetailCatchment (category filter, competitor breakdown) | | CITY | VARCHAR | RetailCatchment (city filter) | | GEOMETRY | GEOGRAPHY | RetailCatchment (ST_X/ST_Y for map, ST_WITHIN for competitors) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RetailCatchment (region filter) | | CITY | VARCHAR | RetailCatchment (city dropdown) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RetailCatchment (region filter) | | GEOMETRY | GEOGRAPHY | RetailCatchment (H3 density, ST_WITHIN catchment filter) |
The deployed app provides:
| Issue | Solution | |-------|----------| | "No stores found" | Verify Overture Maps Places dataset is accessible | | Isochrone fails | Check ORS services are RUNNING | | Dashboard shows no data | Verify RETAIL_POIS table has rows; check column BASIC_CATEGORY, CITY exist | | RETAIL_POIS table empty | Check bounding box config and Overture Maps Places access | | REGIONAL_ADDRESSES table empty | Check bounding box config and Overture Maps Addresses access | | "Object does not exist" on table | Ensure Step 5 completed successfully before Step 6 |
Deployed resources:
FLEET_INTELLIGENCEFLEET_INTELLIGENCE.RETAIL_CATCHMENTROUTING_ANALYTICSCONFIG, RETAIL_POIS, CITIES_BY_STATE, REGIONAL_ADDRESSES, REGION_CONFIGTo remove all objects created by this skill:
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT.CONFIG;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT.REGION_CONFIG;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT.REGIONAL_ADDRESSES;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT.CITIES_BY_STATE;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT.RETAIL_POIS;
DROP SCHEMA IF EXISTS FLEET_INTELLIGENCE.RETAIL_CATCHMENT;
Tip: Use the
cleanupskill to auto-discover all tagged objects via COMMENT tracking.
tools
Optimize, audit, create, and improve Cortex Code skills following official best practices from the Anthropic skill-building guide. Use when: creating a new skill, reviewing an existing skill, optimizing skill description or triggers, improving SKILL.md structure, auditing skill quality, fixing undertriggering or overtriggering, restructuring skill for progressive disclosure. Do NOT use for: general code review, non-skill markdown editing, MCP server development. Triggers: optimize skill, audit skill, review skill, create skill, improve skill, fix skill triggers, skill best practices, skill quality check.
testing
Discover and remove all Snowflake objects created by skills in this repo. Uses the COMMENT tracking tag (sf_sit-is-fleet) to find objects, generates DROP statements, and optionally executes them. Use when: cleaning up after a demo, removing all skill-created objects, tearing down an environment, uninstalling a specific skill's objects. Do NOT use for: dropping objects not created by these skills, production environment cleanup without review. Triggers: routing-solution-cleanup, cleanup, teardown, remove, uninstall, drop all, clean up demo, remove skill objects, reset environment.
tools
Check and install build prerequisites for the Routing Solution project. Use when: verifying environment setup before building, checking if Docker/Podman/snow CLI are installed, confirming readiness to build. Do NOT use for: building the routing solution itself (use build-routing-solution), deploying demos, or changing ORS configuration. Triggers: check prerequisites, check build prerequisites, am I ready to build, what do I need installed, verify environment setup, Docker installed, Podman installed, snow CLI installed.
tools
Enable or disable ORS routing profiles (driving-car, driving-hgv, cycling, walking, wheelchair). Subskill of routing-customization — must be invoked from the router, not independently. Use when: changing vehicle types as part of customization workflow. Do NOT use for: standalone execution, changing map region, or deploying demo apps. Triggers: change routing profile, change vehicle type, enable profile, disable profile.