Customization Router
This skill routes customization requests to the correct subskills based on what you want to customize.
Configuration
| Parameter |
Default |
Description |
ORS_APP_NAME |
OPENROUTESERVICE_APP |
Name of the installed ORS app |
COMPUTE_POOL |
OPENROUTESERVICE_APP_COMPUTE_POOL |
Compute pool used by ORS services |
MAP_REGION |
(current) |
Target geographic region for the map data |
ROUTING_PROFILES |
(current) |
Comma-separated list of profiles to enable |
Required Privileges
| Privilege |
Scope |
Reason |
| USAGE ON DATABASE OPENROUTESERVICE_APP |
DATABASE |
Reads and modifies ORS configuration |
| ALTER COMPUTE POOL |
Compute Pool |
Suspends/resumes compute pool for config changes |
| ALTER SERVICE |
Application |
Suspends/resumes ORS services and updates specs |
| INSERT/DELETE ON OPENROUTESERVICE_APP.CORE.MAP_CONFIG |
Table |
Updates map configuration for Function Tester |
Error Logging
Follow the Error Logging convention in AGENTS.md. Log file prefix: routing-customization.
Workflow
All file paths in subskills (e.g., .cortex/skills/install-fleet-apps/openrouteservice_app/...) are relative to the repository root directory.
Query Tag
Set at the start of every session:
ALTER SESSION SET query_tag = '{"origin":"sf_sit-is-fleet","name":"oss-routing-customization","version":{"major":1,"minor":0},"attributes":{"is_quickstart":1,"source":"sql"}}';
Step 1: Read Initial ORS Configuration and Gather Customization Options
Goal: Detect the initial map region and routing profiles from the ORS configuration and display to the user
Read and follow the instructions in .cortex/skills/routing-customization/read-ors-configuration/SKILL.md
Output: ORS configuration displayed to the user:
- Initially configured Map Region:
<INITIAL_REGION_NAME>
- Initially configured Vehicle profiles:
<INITIAL_PROFILES>
Step 2: Determine What to Customize
Ask the user (allow multiple selections):
"What would you like to customize? Multiple selection is allowed."
- Location/Map - Change the geographic region (e.g., San Francisco → Paris)
- Routing Profiles - Enable/disable routing profiles (driving-car, driving-hgv, cycling-electric)
IMPORTANT: Use multi-select so the user can choose one or both options. If both are selected, run the location skill first, then the routing profiles skill, before proceeding to Step 4.
Step 3: Route to Correct Skill
If user wants to change LOCATION or MAP:
This requires changing a map.
Read and follow the instructions in .cortex/skills/routing-customization/location/SKILL.md
If user wants to change ROUTING PROFILES:
This updates which routing profiles are available.
Read and follow the instructions in .cortex/skills/routing-customization/routing-profiles/SKILL.md
Step 4: Update Routing Graphs
Goal: Restart services to update routing graphs with new location
Actions:
Determine if this is a new region or an existing region re-download:
New region (no prior graphs exist): Skip the REMOVE commands and proceed directly to resuming services. The graphs stage paths won't exist yet.
Existing region re-download (map existed and user selected to re-download): Ask the user:
- "Do you want to rebuild the routing graphs for this region? This will clear existing cached graphs and elevation data, forcing a fresh rebuild."
If existing region and user confirms YES, clear existing graphs and elevation cache:
REMOVE @OPENROUTESERVICE_APP.CORE.ORS_ELEVATION_CACHE_SPCS_STAGE/<REGION_NAME>/;
REMOVE @OPENROUTESERVICE_APP.CORE.ORS_GRAPHS_SPCS_STAGE/<REGION_NAME>/;
NOTE: This ensures graphs are rebuilt from scratch with the new map data rather than using potentially stale cached data.
Resume the compute pool (required if it was suspended during location change):
ALTER COMPUTE POOL OPENROUTESERVICE_APP_COMPUTE_POOL RESUME;
Resume all services:
CALL OPENROUTESERVICE_APP.CORE.RESUME_ALL_SERVICES();
Verify ORS is healthy:
SELECT OPENROUTESERVICE_APP.CORE.CHECK_HEALTH();
Monitor ORS_SERVICE logs for graph building progress:
CALL SYSTEM$GET_SERVICE_LOGS('OPENROUTESERVICE_APP.CORE.ORS_SERVICE', 0, 'ors', 100);
- Look for:
"Graph built in X seconds" messages for each enabled profile
Note: Graph building can take 30 minutes to several hours depending on map size and number of enabled profiles.
Output: Services rebuilding with new map
Step 5: Update MAP_CONFIG Table
Goal: Store map configuration so Function Tester can dynamically load settings
Actions:
Clear any existing configuration:
DELETE FROM OPENROUTESERVICE_APP.CORE.MAP_CONFIG;
Insert the new map configuration:
INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('<CITY_NAME>', <CENTER_LAT>, <CENTER_LON>, <MIN_LAT>, <MAX_LAT>, <MIN_LON>, <MAX_LON>, '<MAP_NAME>', CURRENT_TIMESTAMP());
NOTE: The updated_at column is required -- the Function Tester uses ORDER BY updated_at DESC LIMIT 1 to load the latest config.
Example for Paris:
INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('Paris', 48.8566, 2.3522, 48.80, 48.92, 2.22, 2.42, 'Paris.osm.pbf', CURRENT_TIMESTAMP());
Example for Berlin:
INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('Berlin', 52.5200, 13.4050, 52.35, 52.70, 13.08, 13.77, 'Berlin.osm.pbf', CURRENT_TIMESTAMP());
Verify the configuration was saved:
SELECT * FROM OPENROUTESERVICE_APP.CORE.MAP_CONFIG;
Note: The Function Tester will automatically generate test addresses within these bounds when it loads. If no MAP_CONFIG entry exists, it defaults to San Francisco.
Output: MAP_CONFIG table updated with new region bounds
Step 6: Redeploy SPCS APP
Goal: Upload and redeploy the Function Tester so it picks up the new MAP_CONFIG
Note: The Function Tester automatically reads the MAP_CONFIG table (updated in Step 5) and dynamically generates region-specific sample addresses within those bounds. No manual code edits are needed for addresses - just redeploy.
NOTE: The React-based Function Tester in the ORS Control App dynamically loads installed profiles from ORS_STATUS - no hardcoded profile list to update.
Actions:
- Follow instructions from AGENT.MD to deploy new ors control app
Output: Function Tester redeployed, now showing addresses for the new region
Examples
Example 1: Change location from San Francisco to Paris
User says: "Change the map to Paris"
Actions:
- Read current ORS configuration (Step 1)
- Route to location subskill (Step 3)
- Download Paris city map from BBBike, upload to stage
- Update routing graphs (Step 4), MAP_CONFIG (Step 5), redeploy Function Tester (Step 6)
Result: ORS serves routes for Paris, Function Tester shows Paris addresses
Example 2: Enable additional routing profiles
User says: "Add walking and cycling-regular profiles"
Actions:
- Read current ORS configuration (Step 1)
- Route to routing-profiles subskill (Step 3)
- Call WRITE_ORS_CONFIG with updated profile list
- Rebuild routing graphs (Step 4)
Result: ORS serves routes for walking, cycling-regular, and previously enabled profiles
Example 3: Change both location and profiles
User says: "Switch to London with driving-car and foot-walking only"
Actions:
- Read current ORS configuration (Step 1)
- User selects both Location and Routing Profiles (Step 2)
- Run location subskill first, then routing-profiles subskill (Step 3)
- Rebuild graphs, update MAP_CONFIG, redeploy Function Tester (Steps 4-6)
Result: ORS serves London routes for driving-car and foot-walking
Stopping Points
- ✋ After Step 3: Confirm map download completed
- ✋ After Step 4: Verify services are rebuilding graphs
- ✋ After Step 5: Verify MAP_CONFIG table has correct bounds
- ✋ After Step 6: Verify Function Tester shows new region addresses
Cleanup
This skill modifies ORS configuration but does not create persistent objects. To revert changes:
- Re-run the location subskill to change back to the original region
- Re-run the routing-profiles subskill to restore original profile settings
- Restart services via Step 4
Tip: Use the cleanup skill to auto-discover all tagged objects via COMMENT tracking.
1---2name: routing-customization3description: Route customization requests to the correct subskills. Use when: changing location, changing map, changing vehicle, changing routing profile. Do NOT use for: initial ORS deployment (use install-fleet-apps), deploying demo apps, or reading ORS config only (use read-ors-configuration subskill directly). Triggers: change location, change map, change vehicle, change routing profile, change routing profiles.4---56# Customization Router78This skill routes customization requests to the correct subskills based on what you want to customize.910## Configuration1112| Parameter | Default | Description |13|-----------|---------|-------------|14| `ORS_APP_NAME` | `OPENROUTESERVICE_APP` | Name of the installed ORS app |15| `COMPUTE_POOL` | `OPENROUTESERVICE_APP_COMPUTE_POOL` | Compute pool used by ORS services |16| `MAP_REGION` | (current) | Target geographic region for the map data |17| `ROUTING_PROFILES` | (current) | Comma-separated list of profiles to enable |1819## Required Privileges2021| Privilege | Scope | Reason |22|-----------|-------|--------|23| USAGE ON DATABASE OPENROUTESERVICE_APP | DATABASE | Reads and modifies ORS configuration |24| ALTER COMPUTE POOL | Compute Pool | Suspends/resumes compute pool for config changes |25| ALTER SERVICE | Application | Suspends/resumes ORS services and updates specs |26| INSERT/DELETE ON OPENROUTESERVICE_APP.CORE.MAP_CONFIG | Table | Updates map configuration for Function Tester |2728## Error Logging2930> Follow the Error Logging convention in AGENTS.md. Log file prefix: `routing-customization`.3132## Workflow3334> All file paths in subskills (e.g., `.cortex/skills/install-fleet-apps/openrouteservice_app/...`) are relative to the repository root directory.3536### Query Tag3738Set at the start of every session:3940```sql41ALTER SESSION SET query_tag = '{"origin":"sf_sit-is-fleet","name":"oss-routing-customization","version":{"major":1,"minor":0},"attributes":{"is_quickstart":1,"source":"sql"}}';42```4344### Step 1: Read Initial ORS Configuration and Gather Customization Options4546**Goal:** Detect the initial map region and routing profiles from the ORS configuration and display to the user4748> Read and follow the instructions in `.cortex/skills/routing-customization/read-ors-configuration/SKILL.md`4950**Output:** ORS configuration displayed to the user:51- Initially configured Map Region: `<INITIAL_REGION_NAME>`52- Initially configured Vehicle profiles: `<INITIAL_PROFILES>`5354### Step 2: Determine What to Customize5556**Ask the user (allow multiple selections):**5758"What would you like to customize? Multiple selection is allowed."59601. **Location/Map** - Change the geographic region (e.g., San Francisco → Paris)612. **Routing Profiles** - Enable/disable routing profiles (driving-car, driving-hgv, cycling-electric)6263**IMPORTANT:** Use multi-select so the user can choose one or both options. If both are selected, run the location skill first, then the routing profiles skill, before proceeding to Step 4.6465### Step 3: Route to Correct Skill6667**If user wants to change LOCATION or MAP:**6869> This requires changing a map. 70> Read and follow the instructions in `.cortex/skills/routing-customization/location/SKILL.md`7172**If user wants to change ROUTING PROFILES:**7374> This updates which routing profiles are available.75> Read and follow the instructions in `.cortex/skills/routing-customization/routing-profiles/SKILL.md`7677### Step 4: Update Routing Graphs7879**Goal:** Restart services to update routing graphs with new location8081**Actions:**82831. **Determine if this is a new region or an existing region re-download:**8485 - **New region** (no prior graphs exist): Skip the REMOVE commands and proceed directly to resuming services. The graphs stage paths won't exist yet.86 87 - **Existing region re-download** (map existed and user selected to re-download): Ask the user:88 - "Do you want to rebuild the routing graphs for this region? This will clear existing cached graphs and elevation data, forcing a fresh rebuild."89902. **If existing region and user confirms YES**, clear existing graphs and elevation cache:91 ```sql92 REMOVE @OPENROUTESERVICE_APP.CORE.ORS_ELEVATION_CACHE_SPCS_STAGE/<REGION_NAME>/;93 REMOVE @OPENROUTESERVICE_APP.CORE.ORS_GRAPHS_SPCS_STAGE/<REGION_NAME>/;94 ```95 96 > **_NOTE:_** This ensures graphs are rebuilt from scratch with the new map data rather than using potentially stale cached data.97983. **Resume** the compute pool (required if it was suspended during location change):99 ```sql100 ALTER COMPUTE POOL OPENROUTESERVICE_APP_COMPUTE_POOL RESUME;101 ```1021034. **Resume** all services:104 ```sql105 CALL OPENROUTESERVICE_APP.CORE.RESUME_ALL_SERVICES();106 ```1071085. **Verify** ORS is healthy:109 ```sql110 SELECT OPENROUTESERVICE_APP.CORE.CHECK_HEALTH();111 ```1121136. **Monitor** ORS_SERVICE logs for graph building progress:114 ```sql115 CALL SYSTEM$GET_SERVICE_LOGS('OPENROUTESERVICE_APP.CORE.ORS_SERVICE', 0, 'ors', 100);116 ```117 - Look for: `"Graph built in X seconds"` messages for each enabled profile118119**Note:** Graph building can take 30 minutes to several hours depending on map size and number of enabled profiles.120121**Output:** Services rebuilding with new map122123### Step 5: Update MAP_CONFIG Table124125**Goal:** Store map configuration so Function Tester can dynamically load settings126127**Actions:**1281291. **Clear** any existing configuration:130 ```sql131 DELETE FROM OPENROUTESERVICE_APP.CORE.MAP_CONFIG;132 ```1331342. **Insert** the new map configuration:135 ```sql136 INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG 137 (city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)138 VALUES ('<CITY_NAME>', <CENTER_LAT>, <CENTER_LON>, <MIN_LAT>, <MAX_LAT>, <MIN_LON>, <MAX_LON>, '<MAP_NAME>', CURRENT_TIMESTAMP());139 ```140 141 > **_NOTE:_** The `updated_at` column is required -- the Function Tester uses `ORDER BY updated_at DESC LIMIT 1` to load the latest config.142 143 **Example for Paris:**144 ```sql145 INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG 146 (city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)147 VALUES ('Paris', 48.8566, 2.3522, 48.80, 48.92, 2.22, 2.42, 'Paris.osm.pbf', CURRENT_TIMESTAMP());148 ```149 150 **Example for Berlin:**151 ```sql152 INSERT INTO OPENROUTESERVICE_APP.CORE.MAP_CONFIG 153 (city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)154 VALUES ('Berlin', 52.5200, 13.4050, 52.35, 52.70, 13.08, 13.77, 'Berlin.osm.pbf', CURRENT_TIMESTAMP());155 ```1561573. **Verify** the configuration was saved:158 ```sql159 SELECT * FROM OPENROUTESERVICE_APP.CORE.MAP_CONFIG;160 ```161162**Note:** The Function Tester will automatically generate test addresses within these bounds when it loads. If no MAP_CONFIG entry exists, it defaults to San Francisco.163164**Output:** MAP_CONFIG table updated with new region bounds165166### Step 6: Redeploy SPCS APP167168**Goal:** Upload and redeploy the Function Tester so it picks up the new MAP_CONFIG169170**Note:** The Function Tester automatically reads the MAP_CONFIG table (updated in Step 5) and dynamically generates region-specific sample addresses within those bounds. No manual code edits are needed for addresses - just redeploy.171172> **_NOTE:_** The React-based Function Tester in the ORS Control App dynamically loads installed profiles from ORS_STATUS - no hardcoded profile list to update.173174**Actions:**1751761. Follow instructions from AGENT.MD to deploy new ors control app177178**Output:** Function Tester redeployed, now showing addresses for the new region179180## Examples181182### Example 1: Change location from San Francisco to Paris183User says: "Change the map to Paris"184Actions:1851. Read current ORS configuration (Step 1)1862. Route to location subskill (Step 3)1873. Download Paris city map from BBBike, upload to stage1884. Update routing graphs (Step 4), MAP_CONFIG (Step 5), redeploy Function Tester (Step 6)189Result: ORS serves routes for Paris, Function Tester shows Paris addresses190191### Example 2: Enable additional routing profiles192User says: "Add walking and cycling-regular profiles"193Actions:1941. Read current ORS configuration (Step 1)1952. Route to routing-profiles subskill (Step 3)1963. Call WRITE_ORS_CONFIG with updated profile list1974. Rebuild routing graphs (Step 4)198Result: ORS serves routes for walking, cycling-regular, and previously enabled profiles199200### Example 3: Change both location and profiles201User says: "Switch to London with driving-car and foot-walking only"202Actions:2031. Read current ORS configuration (Step 1)2042. User selects both Location and Routing Profiles (Step 2)2053. Run location subskill first, then routing-profiles subskill (Step 3)2064. Rebuild graphs, update MAP_CONFIG, redeploy Function Tester (Steps 4-6)207Result: ORS serves London routes for driving-car and foot-walking208209## Stopping Points210211- ✋ After Step 3: Confirm map download completed212- ✋ After Step 4: Verify services are rebuilding graphs213- ✋ After Step 5: Verify MAP_CONFIG table has correct bounds214- ✋ After Step 6: Verify Function Tester shows new region addresses215216## Cleanup217218This skill modifies ORS configuration but does not create persistent objects. To revert changes:2192201. Re-run the location subskill to change back to the original region2212. Re-run the routing-profiles subskill to restore original profile settings2223. Restart services via Step 4223224> **Tip:** Use the `cleanup` skill to auto-discover all tagged objects via COMMENT tracking.