.cortex/skills/routing-customization/location/SKILL.md
Change the OpenRouteService map region by downloading new OSM data and updating service configuration. Subskill of routing-customization — must be invoked from the router, not independently. Use when: changing ORS map region as part of customization workflow. Do NOT use for: standalone execution, reading current config, or changing routing profiles. Triggers: change location, change map, download map, new region.
npx skillsauth add snowflake-labs/sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator locationInstall 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.
WARNING: This subskill cannot be run independently. It must be invoked from the
routing-customizationrouter. It does not restart services, rebuild graphs, update MAP_CONFIG, or redeploy the Function Tester -- the router handles all of those in Steps 4-6 after this subskill completes.
Downloads a new OpenStreetMap region map and update the configuration files.
This skill handles:
<REGION_NAME>: Target region name selected by user (e.g., "great-britain", "switzerland", "new-york")<MAP_NAME>: OSM file name (e.g., "great-britain-latest.osm.pbf")<URL>: Download URL from geofabrik.de or bbbike.orgFollow the Error Logging convention in AGENTS.md. Log file prefix:
routing-customization.
Goal: Suspend the compute pool to allow configuration changes
Actions:
ALTER COMPUTE POOL OPENROUTESERVICE_NATIVE_APP_COMPUTE_POOL SUSPEND;
Output: Compute pool suspended
Goal: Download OSM map data locally and upload to Snowflake stage
Note: This step no longer requires a Snowflake Notebook, compute pool, or external access integration. The download runs locally via a Python script.
Goal: Download OSM map data and upload to Snowflake stage
Actions:
Check if map already exists:
ALTER STAGE OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SPCS_STAGE REFRESH;
LS @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SPCS_STAGE;
Run the download script from build-routing-solution/scripts/:
python download_map.py \
"https://download.geofabrik.de/europe/<region>-latest.osm.pbf" \
"<region>-latest.osm.pbf" \
"<region>" \
--connection <connection>
Parameters:
https://download.geofabrik.de/europe/switzerland-latest.osm.pbf)switzerland-latest.osm.pbf)switzerland)--connection: Snowflake connection nameNote: Large maps (>1GB) will take time to download. The script shows progress.
Check downloaded map size and suggest resource scaling:
LS @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SPCS_STAGE/<REGION_NAME>/;
1GB - 5GB maps: Suggest scaling up compute:
ALTER COMPUTE POOL OPENROUTESERVICE_NATIVE_APP_COMPUTE_POOL SET INSTANCE_FAMILY = HIGHMEM_X64_M;
ALTER SERVICE OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SERVICE SET AUTO_SUSPEND_SECS = 28800;
5GB+ maps: Suggest larger scaling:
ALTER COMPUTE POOL OPENROUTESERVICE_NATIVE_APP_COMPUTE_POOL SET INSTANCE_FAMILY = HIGHMEM_X64_M;
ALTER SERVICE OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SERVICE SET AUTO_SUSPEND_SECS = 86400;
Output: Map data downloaded to stage
Goal: Modify ors-config.yml to reference new map file
Actions:
Option A — Using WRITE_ORS_CONFIG (recommended):
CALL OPENROUTESERVICE_NATIVE_APP.CORE.WRITE_ORS_CONFIG(
'<REGION_NAME>',
'<MAP_NAME>',
'driving-car,driving-hgv,cycling-electric' -- comma-separated profiles to enable
);
Option B — Manual editing (fallback):
Edit .cortex/skills/build-routing-solution/native_app/provider_setup/staged_files/ors-config.yml:
source_file: /home/ors/files/{old-map}source_file: /home/ors/files/<MAP_NAME>Upload to stage:
snow stage copy .cortex/skills/build-routing-solution/native_app/provider_setup/staged_files/ors-config.yml @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SPCS_STAGE/<REGION_NAME>/ --connection <ACTIVE_CONNECTION> --overwrite
Output: Configuration updated
Goal: Reconfigure ORS service to point to new map region
Actions:
Edit .cortex/skills/build-routing-solution/native_app/services/openrouteservice/openrouteservice.yaml:
volumes:
- name: files
source: "@CORE.ORS_SPCS_STAGE/<REGION_NAME>"
- name: graphs
source: "@CORE.ORS_GRAPHS_SPCS_STAGE/<REGION_NAME>"
- name: elevation-cache
source: "@CORE.ORS_ELEVATION_CACHE_SPCS_STAGE/<REGION_NAME>"
Upload specification:
snow stage copy .cortex/skills/build-routing-solution/native_app/services/openrouteservice/openrouteservice.yaml @openrouteservice_native_app_pkg.app_src.stage/services/openrouteservice/ --connection <ACTIVE_CONNECTION> --overwrite
Update service with new specification:
ALTER SERVICE IF EXISTS OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SERVICE
FROM @openrouteservice_native_app_pkg.app_src.stage
SPECIFICATION_FILE='/services/openrouteservice/openrouteservice.yaml';
_IMPORTANT: DO NOT modify the
REBUILD_GRAPHSparameter in openrouteservice.yaml
Output: Service configured for new region
When the user asks to change location, always ask if they want a city-only map or a larger region:
"Do you want just the city of Paris (faster download, quicker graph build) or the entire France region (larger coverage, longer build time)?"
For city-only maps, use BBBike.org which offers pre-built city extracts:
| City | URL | Approximate Size |
|------|-----|------------------|
| Paris | https://download.bbbike.org/osm/bbbike/Paris/Paris.osm.pbf | ~100MB |
| London | https://download.bbbike.org/osm/bbbike/London/London.osm.pbf | ~150MB |
| Berlin | https://download.bbbike.org/osm/bbbike/Berlin/Berlin.osm.pbf | ~80MB |
| New York | https://download.bbbike.org/osm/bbbike/NewYork/NewYork.osm.pbf | ~200MB |
| Tokyo | https://download.bbbike.org/osm/bbbike/Tokyo/Tokyo.osm.pbf | ~150MB |
| Sydney | https://download.bbbike.org/osm/bbbike/Sydney/Sydney.osm.pbf | ~80MB |
| Amsterdam | https://download.bbbike.org/osm/bbbike/Amsterdam/Amsterdam.osm.pbf | ~50MB |
| Munich | https://download.bbbike.org/osm/bbbike/Muenchen/Muenchen.osm.pbf | ~60MB |
| Barcelona | https://download.bbbike.org/osm/bbbike/Barcelona/Barcelona.osm.pbf | ~70MB |
| Rome | https://download.bbbike.org/osm/bbbike/Roma/Roma.osm.pbf | ~60MB |
TIP: Browse all available cities at: https://download.bbbike.org/osm/bbbike/
For full country or region coverage, use Geofabrik:
| Region | URL | Approximate Size |
|--------|-----|------------------|
| Great Britain | https://download.geofabrik.de/europe/great-britain-latest.osm.pbf | ~1.5GB |
| France | https://download.geofabrik.de/europe/france-latest.osm.pbf | ~4GB |
| Germany | https://download.geofabrik.de/europe/germany-latest.osm.pbf | ~3.5GB |
| Switzerland | https://download.geofabrik.de/europe/switzerland-latest.osm.pbf | ~350MB |
| New York State | https://download.geofabrik.de/north-america/us/new-york-latest.osm.pbf | ~500MB |
| California | https://download.geofabrik.de/north-america/us/california-latest.osm.pbf | ~1GB |
TIP: Browse all regions at: https://download.geofabrik.de/
After completing all steps in this subskill, return to the routing-customization router and continue from Step 4: Update Routing Graphs. This subskill does NOT restart services or rebuild graphs -- the router handles that.
Map region changed to <REGION_NAME>.
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.