Summit 26 from June 1-4 in San Francisco

Lead your organization in the era of agents and enterprise intelligence.

Snowflake for DevelopersGuidesDeploy Fleet Intelligence Solution for Taxis
Certified Solution

Deploy Fleet Intelligence Solution for Taxis

Cortex LLM
Becky O'Connor, Piotr Paczewski, Oleksii Bielov

🚖 Track. Analyze. Optimize. Build a real-time taxi fleet control center with AI-powered insights - powered by OpenRouteService in Snowflake.

Overview

Fleet Intelligence Control Center

Build a fully interactive Fleet Intelligence Control Center using the OpenRouteService Native App.

This quickstart deploys a multi-page Streamlit application that simulates a taxi fleet operations dashboard. Track individual drivers, visualize routes in real-time, and analyze fleet density with interactive heat maps - all powered by Snowflake's geospatial capabilities.

What You'll Build

🚖 Fleet Intelligence Control Center - A multi-page Streamlit dashboard that:

  • Tracks individual driver journeys with route visualization
  • Provides AI-powered trip analysis using Snowflake Cortex
  • Displays fleet density heat maps with H3 hexagon visualization
  • Shows driver performance metrics including speed and distance analytics

📊 Fleet Analytics - Real-time insights including:

  • Driver route tracking with pickup/dropoff locations
  • Time-based filtering to analyze trips by hour
  • Speed distribution analysis across the fleet
  • Interactive maps with pydeck visualization

Prerequisites

IMPORTANT: This demo requires the OpenRouteService Native App to be installed and running. If you haven't built it yet, complete the Build Routing Solution in Snowflake quickstart first.

Required:

  • OpenRouteService Native App deployed and activated
  • Cortex Code CLI installed and configured
  • Active Snowflake connection with ACCOUNTADMIN access
  • Overture Maps Places and Addresses datasets from Snowflake Marketplace

What You'll Learn

  • Deploy fleet analytics dashboards using Cortex Code skills
  • Work with Carto Overture Maps datasets for realistic location data
  • Use Snowflake Cortex AI for trip summaries and analysis
  • Build multi-layer geospatial visualizations with Pydeck
  • Create H3 hexagon heat maps for density analysis
  • Track driver states (waiting, pickup, driving, dropoff, idle)

Deploy the Fleet Intelligence Solution

Use Cortex Code to deploy the Fleet Intelligence solution including database setup, data generation, and the Streamlit dashboard.

Clone Repository and Deploy Skill

Clone the repository:

git clone https://github.com/Snowflake-Labs/sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator
cd sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator

In the Cortex Code CLI, type:

$deploy-fleet-intelligence-taxis

NOTE: The skill will first verify that the OpenRouteService Native App is installed. If it's not found, it will provide instructions to install it first.

The skill uses interactive prompting to gather required information:

  • Number of drivers: 20 to 500+ (default: 80)
  • Number of days: 1 to 30+ (default: 1)
  • City: San Francisco (default), New York, London, Paris, Chicago, or any custom city

Cortex Code will automatically:

  • Detect ORS Configuration - Reads the current OpenRouteService map region and enabled routing profiles, then recommends a matching city. If the selected city doesn't match the configured region, it will guide you through changing the map
  • Verify OpenRouteService Native App is installed and running
  • Create Schema - Sets up OPENROUTESERVICE_SETUP.FLEET_INTELLIGENCE_TAXIS with required objects
  • Generate Sample Data - Creates drivers, trips, and routes using ORS
  • Deploy Dashboard - Creates the Taxi Control Center Streamlit app

What Gets Installed

The deploy skill creates the following Snowflake objects:

Marketplace Data

ComponentNameDescription
DatabaseOVERTURE_MAPS__PLACESCarto Overture Maps Places with POI data
DatabaseOVERTURE_MAPS__ADDRESSESCarto Overture Maps Addresses

Fleet Intelligence Database

ComponentNameDescription
DatabaseOPENROUTESERVICE_SETUPMain setup database
SchemaOPENROUTESERVICE_SETUP.FLEET_INTELLIGENCE_TAXISCore data tables and views
WarehouseROUTING_ANALYTICSCompute warehouse, XSMALL (auto-suspend 60s)
StageSTREAMLIT_STAGEStage for Streamlit files

Data Tables

TableDescription
TAXI_LOCATIONSPOIs and addresses from Overture Maps for the target city
TAXI_LOCATIONS_NUMBEREDIndexed location pool for deterministic trip assignment
TAXI_DRIVERSConfigured drivers with shift assignments
DRIVER_TRIPSTrip assignments per driver
DRIVER_TRIPS_WITH_COORDSTrips with pickup/dropoff coordinates
DRIVER_ROUTESRaw ORS route responses
DRIVER_ROUTES_PARSEDParsed route geometries and distances
DRIVER_ROUTE_GEOMETRIESRoutes with timing data
DRIVER_LOCATIONSInterpolated GPS positions with driver states

Analytics Views

ViewDescription
DRIVER_LOCATIONS_VLocation points with LON/LAT and state
TRIPS_ASSIGNED_TO_DRIVERSTrip routes with geometry
ROUTE_NAMESHuman-readable route descriptions
TRIP_ROUTE_PLANRoute data for Heat Map page
TRIP_SUMMARYTrip statistics and speed metrics

Streamlit Application

ComponentNameDescription
StreamlitTAXI_CONTROL_CENTERMulti-page fleet dashboard

Explore the Control Center

Once deployment completes, navigate to the Fleet Intelligence Control Center:

  1. Go to Projects > Streamlits in Snowsight
  2. Click on Taxi Control Center

Main Dashboard

The main page shows fleet overview statistics:

  • Total Trips - Number of trips in the simulation
  • Active Drivers - Drivers with assigned trips
  • Total Distance - Combined distance driven across all routes
  • Location Points - Number of location data points in the simulation

Driver Routes Page

Driver Performance Summary

Track individual driver journeys:

  1. Select a Driver from the sidebar dropdown

  2. Choose a Trip to visualize the route

  3. View the Map with:

    • Route geometry (orange line)
    • Pickup and dropoff locations (blue markers)
    • Current driver position (dark marker) controlled by a time slider
  4. Analyze Trip Details:

    • Total distance traveled
    • Trip duration
    • Average speed
    • AI-generated trip summary using Cortex

NOTE: The AI trip analysis feature uses Snowflake Cortex AI (by default claude-3-5-sonnet). Other LLM models available in your account can also be used. Ensure Cortex AI is enabled in your Snowflake region.

Individual Route Visualization

Fleet Heat Map Page

Fleet Heat Map

This page combines fleet statistics with an interactive density map.

Top Section - Fleet Statistics:

  • Top Streets - Most popular pickup and dropoff locations
  • Route Distances - Shortest and longest routes across all drivers

Map Section - Driver Density:

Use the sidebar controls to explore fleet distribution:

  1. Time Slice - Select both Hour (0-23) and Minute (0-59) to see each driver's latest position at that moment
  2. Show Driver Locations - Toggle clickable dots showing individual driver positions. Click a dot to display its route on the map
  3. H3 Resolution - Adjust hexagon granularity (6-9) for density aggregation
  4. Colour Scheme - Choose between "Contrast" and "Snowflake" palettes

Analyze Patterns:

  • Peak hour driver concentrations via H3 hexagons
  • Popular pickup/dropoff zones from the Top Streets charts
  • Coverage gaps in the fleet

Understanding the Data Model

Driver States

The simulation tracks realistic driver states throughout each trip:

Point IndexStateSpeedDescription
0waiting0 km/hWaiting for fare (2-8 min before trip)
1pickup0 km/hPassenger boarding
2-12drivingVariableEn route with traffic simulation
13dropoff0-3 km/hSlowing for passenger exit
14idle0 km/hBrief idle after dropoff

Speed Distribution

Realistic traffic patterns are simulated:

Speed BandPercentageDescription
0 km/h (Stationary)~23%Waiting, pickup, dropoff, idle
1-5 km/h (Crawling)~11%Traffic jams, red lights
6-15 km/h (Slow)~14%Heavy traffic
16-30 km/h (Moderate)~26%Normal city driving
31-45 km/h (Normal)~20%Clear roads
46+ km/h (Fast)~6%Late night, highways

Shift Patterns

Drivers are distributed across 5 shifts for 24-hour coverage:

ShiftHours% of FleetCoverage
Graveyard22:00-06:0010%Overnight
Early04:00-12:0022.5%Morning rush start
Morning06:00-14:0027.5%Full morning rush
Day11:00-19:0022.5%Midday + evening start
Evening15:00-23:0017.5%Evening rush

Customize the Solution

Change Number of Drivers

Edit the driver count in the shift patterns:

-- Default: 80 drivers total
SELECT 1 AS shift_id, 'Graveyard' AS shift_name, 22 AS shift_start, 6 AS shift_end, 8 AS driver_count UNION ALL
SELECT 2, 'Early', 4, 12, 18 UNION ALL
SELECT 3, 'Morning', 6, 14, 22 UNION ALL
SELECT 4, 'Day', 11, 19, 18 UNION ALL
SELECT 5, 'Evening', 15, 23, 14

Change Location or Map

In the Cortex Code CLI, type:

$customize-main

NOTE: See the Build Routing Solution in Snowflake quickstart for more content about location customization.

Scaling Recommendations

DriversDaysEst. RowsWarehouseEst. Time
201~4KSMALL2-3 min
801~18KMEDIUM5-8 min
807~125KLARGE20-30 min
2001~45KLARGE15-20 min
2007~315KXLARGE45-60 min
5007~800KXLARGE2-3 hours

Uninstall the Solution

To remove the Fleet Intelligence solution execute:

DROP SCHEMA OPENROUTESERVICE_SETUP.FLEET_INTELLIGENCE_TAXIS;

This will remove the OPENROUTESERVICE_SETUP.FLEET_INTELLIGENCE_TAXIS schema and its contents.

NOTE: The OpenRouteService Native App remains installed. You can uninstall it separately.

Available Cortex Code Skills

SkillDescriptionCommand
deploy-fleet-intelligence-taxisDeploy the full solution (data generation, routes, and Streamlit app)$deploy fleet intelligence dashboard$

Conclusion and Resources

Conclusion

You've deployed a complete Fleet Intelligence Control Center that demonstrates:

  • OpenRouteService Native App - Real road-following route generation
  • Snowflake Cortex AI - AI-powered trip summaries and analysis
  • Pydeck Visualization - Interactive maps with multiple layer types
  • H3 Hexagons - Spatial aggregation for density analysis

What You Learned

  • Deploy fleet analytics solutions using Cortex Code skills
  • Generate simulated taxi fleet data with realistic patterns
  • Track driver states and positions over time
  • Build heat maps with H3 hexagon visualization
  • Use AI for trip analysis and fleet insights

Related Quickstarts

Source Code

OpenRouteService Resources

Cortex Code & Snowflake

Updated 2026-02-27

This content is provided as is, and is not maintained on an ongoing basis. It may be out of date with current Snowflake instances