inDrive Logo

Revolutionizing
traffic analysis system in Astana

Traffic Intensity Map

Smooth traffic visualization with 21-color gradient spectrum.

Very Dark Green: Minimum (0.0)

Forest Green: Low (0.1)

Bright Green: Good (0.25)

Pale Green: Moderate (0.35)

Mint: Medium (0.45)

Yellow-Green: Elevated (0.5)

Yellow: Notable (0.65)

Gold: High (0.7)

Orange-Yellow: Serious (0.75)

Orange: Heavy (0.8)

Red-Orange: Critical (0.85)

Red: Traffic Jam (0.9)

Dark Red: Maximum (1.0)

Smooth transitions between all 21 spectrum colors

Background

Challenging coding to make
the Astana's traffic jams
more understandable

Chapter image

Trajectory Analysis

We analyzed 1,262,687 records from 6,805 vehicles. Average number of points per vehicle is 185, maximum 5,909.

Examples:
Car 1: 316 points, average speed 13.9 km/h, distance 342.7 km
Car 2: 263 points, average speed 7.56 km/h, distance 161.5 km

Chapter image

Map Segmentation

The map is divided into cells of 10-20 meters. For each cell we store: ID, center coordinates, latitude and longitude boundaries. This allows us to analyze movement with precision down to specific road sections.

Chapter image

Congestion Calculation Algorithm

We use the 90th percentile of speeds as base speed:
base_speed = np.percentile(speeds[speeds > 0], 90)

Then calculate congestion coefficient:
congestion = (base_speed - avg_speed) / base_speed

Result: number from 0 (free flow) to 1 (almost stopped).

Chapter image

Handling Special Cases

If base speed < 15 km/h (courtyards, parking lots) → set minimum congestion 0.1

If points < 5 → cell is excluded from analysis

This ensures data quality and meaningful results.

Chapter image

Additional Metrics

Speed variation coefficient = movement stability

Point density = statistical reliability
More data = more accurate prediction.

These metrics help validate our congestion analysis.

Chapter image

Visualization and Results

We build an interactive map:

Green — free flow (0.0–0.3)
Yellow — moderate congestion (0.3–0.6)
Red — heavy congestion (0.6–1.0)

Also includes speed map — from blue (slow) to red (fast).