Snowflake for DevelopersGuidesDeploy Fleet Intelligence Solution for Taxis

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 installed it yet, complete the Install OpenRouteService Native App 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 to generate sample addresses
  • 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.

Run the Deploy Skill

In the Cortex Code CLI, type:

use the local skill from oss-deploy-a-fleet-intelligence-solution-for-taxis/skills/deploy-fleet-intelligence

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, or Paris

Cortex Code will automatically:

  • Verify OpenRouteService Native App is installed and running
  • Acquire Marketplace Data - Gets Carto Overture Maps Places and Addresses
  • Create Database - Sets up FLEET_INTELLIGENCE with required schemas
  • Generate Sample Data - Creates drivers, trips, and routes using ORS
  • Deploy Dashboard - Creates the Fleet Intelligence 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
DatabaseFLEET_INTELLIGENCEMain fleet database
SchemaFLEET_INTELLIGENCE.PUBLICCore data tables
SchemaFLEET_INTELLIGENCE.ANALYTICSAnalytics views for Streamlit
WarehouseDEFAULT_WHCompute warehouse (auto-suspend 60s)
StageSTREAMLIT_STAGEStage for Streamlit files

Data Tables

TableDescription
SF_ADDRESSESAI-generated city addresses (150+ locations)
DRIVERSDriver master data with shift patterns
DRIVER_TRIPSTrip assignments per driver
DRIVER_ROUTESRaw ORS route responses
DRIVER_LOCATIONSInterpolated GPS positions with driver states

Analytics Views

ViewDescription
ANALYTICS.DRIVERSDriver display information
ANALYTICS.DRIVER_LOCATIONSLocation points with LON/LAT and state
ANALYTICS.TRIPS_ASSIGNED_TO_DRIVERSTrip routes with geometry
ANALYTICS.ROUTE_NAMESHuman-readable route descriptions
ANALYTICS.TRIP_SUMMARYTrip statistics and metrics

Streamlit Application

ComponentNameDescription
StreamlitFLEET_INTELLIGENCE_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 FLEET_INTELLIGENCE_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
  • Route Plans - Generated route geometries
  • Data Source - City being simulated

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 (blue line)
    • Pickup location (green marker)
    • Dropoff location (red marker)
    • Driver position points along the route
  4. Analyze Trip Details:

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

Fleet Heat Map Page

Fleet Heat Map

Analyze driver density across the city:

  1. Select Time of Day using the hour slider (0-23)

  2. Choose View Type:

    • Heat Map - Traditional heat map visualization
    • Point Cloud - Individual driver positions
    • H3 Hexagons - Aggregated hexagon bins
  3. Analyze Patterns:

    • Peak hour driver concentrations
    • Popular pickup/dropoff zones
    • 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 City

The solution supports multiple cities. Change the bounding box in the data generation:

CityLongitude RangeLatitude Range
San Francisco-122.52 to -122.3537.70 to 37.82
New York City-74.05 to -73.9040.65 to 40.85
London-0.20 to 0.0551.45 to 51.55
Paris2.25 to 2.4248.82 to 48.90

NOTE: When changing cities, ensure your OpenRouteService Native App has the corresponding map data installed. See the Install OpenRouteService Native App quickstart for 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

Generate Additional Data

Generate Driver Locations Skill

To regenerate driver location data with different parameters:

use the local skill from oss-deploy-a-fleet-intelligence-solution-for-taxis/skills/generate-driver-locations

This skill will:

  • Interpolate GPS points along each route
  • Assign realistic driver states
  • Apply traffic-based speed variations
  • Create time-series location data

Uninstall the Solution

To remove the Fleet Intelligence solution:

uninstall fleet intelligence

This will:

  • Remove the FLEET_INTELLIGENCE database
  • Optionally remove Overture Maps marketplace data
  • Optionally remove the warehouse

NOTE: The OpenRouteService Native App remains installed. You can uninstall it separately using: use the local skill from oss-install-openrouteservice-native-app/skills/uninstall-route-optimizer

Available Cortex Code Skills

SkillDescriptionCommand
deploy-fleet-intelligenceDeploy the full solutionuse the local skill from oss-deploy-a-fleet-intelligence-solution-for-taxis/skills/deploy-fleet-intelligence
generate-driver-locationsRegenerate location datause the local skill from oss-deploy-a-fleet-intelligence-solution-for-taxis/skills/generate-driver-locations
uninstall-fleet-intelligenceRemove the solutionuse the local skill from oss-deploy-a-fleet-intelligence-solution-for-taxis/skills/uninstall-fleet-intelligence

Conclusion and Resources

Conclusion

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

  • OpenRouteService Native App - Real road-following route generation
  • Carto Overture Maps - Realistic city locations for simulation
  • Snowflake Cortex AI - AI-generated addresses and trip summaries
  • 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 generating sample data and trip analysis

Related Quickstarts

Source Code

OpenRouteService Resources

Cortex Code & Snowflake

Updated 2026-01-22

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