Saudi Traffic Flow Intelligence
Hourly live traffic collection and route-level time-series analytics across Riyadh, Jeddah, Medina, and Dubai.
By Danyal Jamil · Founder & Principal Builder, Jamil Global
Key results
- 4 cities — Riyadh, Jeddah, Medina, Dubai
- Hourly — Road-level traffic snapshots, 24/7
- 2 scopes — Intercity corridors + intracity roads
- 2 road types — Highways and normal roads tracked
TL;DR
- Built an hourly traffic intelligence pipeline that ingests live road-level data for Saudi cities using HERE API and cloud-native scheduling.
- The system handles both route pairs (city-to-city corridors) and single-city road segments, storing normalized records for every road segment snapshot.
- A 24/7 Cloud Scheduler trigger writes each run to Google Cloud Storage after validation, enabling durable time-series analysis and visualization-ready GeoJSON output.
- The result is a reusable analytics foundation for identifying optimal traffic flow windows on highways and normal roads, with future expansion to broader countries and regions.
Project Overview
We designed a resilient traffic data platform to turn live movement data into decision-ready time-series intelligence.
The project set out to capture live traffic states for roads across multiple Saudi cities and answer operational questions that static traffic reports cannot: Which hours have the best routes? How do congestion patterns differ between highways and normal roads? Where do city-to-city corridors outperform local streets?
The architecture queries live traffic endpoints from HERE API, normalizes responses into a consistent segment model, and persists hourly snapshots with metadata for continuity, deduplication, and trend computation.
- Hourly capture for both intercity and intra-city road coverage
- Time-series modeling for speed, travel-time, and congestion intensity
- GeoJSON conversion for map-based interpretation of patterns and route quality
- Hourly database updates and object storage delivery for downstream BI usage
The pipeline was designed as a production job, not a one-off script: cloud functions, secret-managed credentials, and scheduled execution ensure reliable, repeatable collection and future scaling.
Business Challenge / Problem Statement
Why existing traffic tracking was insufficient for decision-making.
Manual checks or low-frequency traffic reports could not provide the temporal depth needed for route optimization. Teams needed a clear, repeated signal of when roads became optimal or degraded.
Data sources were changing and operationally heavy; without a standardized schema and secure pipeline, historical comparisons were inconsistent and hard to trust.
There was no reliable way to compare road performance across categories (highway vs normal roads) and scale the same process beyond a single corridor or city.
- Missing Time-Series Visibility — Single snapshots did not answer peak-hour questions or long-run route shifts.
- Fragmented Coverage — Intercity corridors and local networks required different query and storage logic.
- Operational Reliability — Manual execution and ad hoc scripts introduced drift, data gaps, and inconsistency.
Objectives & Goals
What the traffic intelligence engine needed to achieve.
Create a robust and secure hourly ingestion system for road-level traffic data in Riyadh, Jeddah, Medina, and Dubai. Then transform raw captures into query-ready time-series metrics to identify optimal hours for both highways and normal roads.
- Consistent Collection — Run traffic captures every hour, every day, with repeatable schedules and failure-aware execution.
- Segment-Level Trends — Track each road segment over time and expose changes in speed, congestion, and travel quality.
- Spatial + Temporal Insight — Render results as GeoJSON and deliver insights that combine map view and trend analytics.
Key Features & Innovations
The solution blends cloud-native execution with geospatial analytics for decision-ready outcomes.
Hourly Traffic Ingestion Engine
A scheduled pipeline polls external traffic APIs and standardizes payloads into a canonical road-segment schema with strong id/type tagging for both highways and normal roads.
City + Route Flexibility
- Intercity scope: Track road pairs between two cities within a country for corridor planning and long-distance optimization.
- Intracity scope: Collect dense local road traffic for city-level route optimization and short-range dispatch planning.
Cloud-Native Reliability Controls
- Cloud Scheduler + Cloud Functions: Reliable 24/7 execution with controlled function invocation and retry behavior.
- Secrets + Buckets: API keys and credentials are handled through managed secrets, while hourly snapshots are stored safely in Cloud Storage.
GeoJSON Output Workflow
Each processed snapshot is transformed into map-ready geometry with segment-level attributes, enabling immediate integration into visualization dashboards and route analysis interfaces.
Time-Series Analytics Layer
Raw data is not left flat; each update is part of a continuous series that supports hour-of-day trend summaries and recurring congestion fingerprints by road type.
Decision-Oriented Findings
- Optimal-hour discovery: Identify low-congestion windows for both highways and normal roads in each city.
- Comparative behavior: Generate city-to-city and road-category insights from the same normalized dataset.
Results & Impact
The pipeline moved the team from one-off checks to continuous, comparable intelligence for road-level decisions.
The system now supports identifying best travel windows and route alternatives based on observed traffic behavior rather than intuition.
The architecture is designed for growth: expanding to additional cities or countries only requires scope configuration and route rules, not a full redesign.
What our clients say
With hourly traffic snapshots and geospatial outputs, we can now validate route decisions using real trend evidence, not static assumptions. The platform clearly improves how we plan for congestion-sensitive operations.
Maya General — Logistics Operations Lead
Technologies & Tools Used
Traffic data pipeline and infrastructure stack
We combined HERE API data access with a Python-based extraction and orchestration layer, and deployed everything on Google Cloud for continuous execution, secure secret handling, and durable artifact storage.
The stack is optimized for stability and scale: scheduled execution, structured ingestion, geospatial transformations, and output delivery for analytics/BI with minimal manual maintenance.
Technology stack
- Python — Core ingestion and transformation engine for API request orchestration, schema normalization, and trend data preparation.
- HERE API — Live traffic and road-network data source for segment-level speed, congestion, and routing context.
- Google Cloud Functions — Serverless runtime to execute each hourly job with controlled compute and isolated execution.
- Google Cloud Scheduler — Event trigger that ensures 24/7 periodic execution and consistent timing guarantees.
- Google Cloud Storage — Durable storage for hourly exports, snapshots, and analysis-ready artifacts.
- Google Cloud Secret Manager — Centralized secret handling for API keys and environment credentials.
- PostgreSQL — Time-series-friendly persistence layer for segment metrics and historical trend queries.
- GeoJSON — Spatial data serialization for route and segment-level visualization on maps.
- Pandas — Dataframe operations for cleaning, enrichment, and trend feature generation.
- Category: Web Scraping
- Technology: Python
- Technology: HERE API
- Technology: Google Cloud
Last updated: 2026-08-03