Route Algorithms

How we calculate safe, efficient cycling routes across Victoria

Production Routing System

This page documents our current production routing implementation running on GraphHopper 10.2. The algorithm has been deployed and refined based on real-world testing and feedback from the Victorian cycling community.

Recent Visual Enhancements (October 2025)

  • ✓ Dual-layer rendering: Routes now display with a wide transparent background layer plus a thin precise foreground line
  • ✓ Solid vs dashed lines: Visual hierarchy shows infrastructure quality at a glance (solid = better protection, dashed = minimal)
  • ✓ Per-segment coloring: Routes dynamically change colors based on infrastructure transitions along the path
  • ✓ Updated color scheme: Cyan for bike lanes, green for protected paths, orange for residential, red for high-traffic

Visual Infrastructure Hierarchy

VicBUG uses a sophisticated dual-layer color-coding system that shows infrastructure quality at a glance. Routes dynamically change colors per-segment based on the actual bike infrastructure present.

Visual cues: Solid lines indicate higher protection, while dashed lines show minimal or intermittent infrastructure.

Protected Lanes & Paths

Green-400SOLID

Highest safety level. Includes protected lanes with physical barriers, separated cycleways, and car-free paths.

GraphHopper tags: cycleway, separated, track, shared_path, sidepath

Buffered Bike Lanes

Cyan-300SOLID

Good protection. Painted buffer zone provides separation between cyclists and motor vehicles.

GraphHopper tags: buffered_lane, lane_buffered

Basic Painted Lanes

Cyan-300DASHED

Moderate protection. Standard painted lanes without buffer. Dashed line indicates minimal physical separation.

GraphHopper tags: lane, designated, basic_lane

Shared Lanes / Parking

Orange-300DASHED

Minimal protection. Lanes shared with parking or buses. Dashed line indicates intermittent availability.

GraphHopper tags: shared_lane, share_busway, shared, shared_parking

Residential Streets

Orange-300SOLID

No bike infrastructure. Quiet, low-traffic residential streets and service roads.

Road types: residential, service, tertiary, living

High-Traffic Roads

Red-500SOLID

Use with caution. Arterial roads, state highways, and primary routes with heavy traffic.

Road types: primary, secondary, trunk, state road

Per-Segment Color Coding

Routes intelligently change colors based on infrastructure transitions. A single route might show green for a protected path, then switch to cyan for a buffered lane, then orange for a residential street - all automatically color-coded to show you exactly what type of infrastructure you'll encounter on each segment.

Road Classification (Fallback Coloring)

When bike infrastructure data is unavailable, routes fall back to road class-based coloring. This ensures all routes are color-coded for safety, even without infrastructure details.

Note: Infrastructure-based colors (above) take priority when available. These colors only apply to segments without bike infrastructure data.

Paths & Trails

Green-400SOLID

Car-free paths, trails, shared trails, bridleways, singletracks

Residential Streets

Orange-300SOLID

Residential, service, tertiary, living streets, unclassified roads

Footways

Teal-300DASHED

Pedestrian-only paths, generally not legal for cycling

High-Traffic Roads

Red-500SOLID

Primary, secondary, trunk, motorway, state roads, steps - use with caution

Bike Routing

VicBUG uses GraphHopper 10.2's standard bike routing profile, enhanced with custom infrastructure preferences to better prioritize protected bike lanes and separated paths across Victoria.

GraphHopper + Infrastructure Preferences

ENHANCED PROFILE

"Standard bike routing enhanced with infrastructure-aware preferences"

We use GraphHopper's proven bike routing as the foundation, then layer on custom multipliers that give preference to bike infrastructure. This balances safety with practical route lengths.

Infrastructure Preference Multipliers:

Protected bike lanes (physical barriers)3.0×
Separated paths (completely car-free)2.5×
Shared paths (off-road, shared with pedestrians)1.5×
Buffered lanes (painted buffer zone)2.0×
Basic lanes (painted lanes, no buffer)1.3×

These multipliers are applied on top of GraphHopper's standard bike routing algorithm, which already considers factors like road type, speed limits, and surface quality.

Dual-Layer Visual Rendering:

All route segments are rendered with a sophisticated two-layer system for maximum clarity:

Layer 1
Background highlight: Wide semi-transparent line (14pt @ 50% opacity) creates a colored "glow" that makes routes easy to spot on the map
Layer 2
Foreground detail: Thin precise line (2.5pt solid or 1pt dashed @ 90-100% opacity) shows exact route path and infrastructure quality

This dual-layer approach ensures routes are visible at all zoom levels while maintaining visual hierarchy through the solid/dashed pattern system.

GraphHopper Profile: bike |Custom Model: bike_custom.json

Safety-Critical Access Control

The routing engine respects one-way streets and access restrictions, preventing dangerous wrong-way routing on divided roads and busy streets.

GraphHopper's bike profile handles bike access rules to ensure routes are both legal and safe for cycling.

Legal Compliance

GraphHopper's bike routing avoids pedestrian-only paths and respects access restrictions, keeping routes legal and safe for cycling.

Routes respect Victorian cycling laws by prioritizing legal bike infrastructure over pedestrian paths, unless explicitly designated as shared.

Multi-Surface Support

GraphHopper's bike routing handles various surfaces (paved, gravel, dirt, unpaved) with appropriate speed adjustments, supporting Victoria's extensive rail trail network.

The routing engine works well for touring and adventure cycling on rail trails and mixed-surface routes across regional Victoria.

Elevation Support

MMAP-based elevation data provides accurate route profiles showing climbs and descents, helping you plan for hills on your ride.

Elevation profiles are displayed in the route planner, showing total ascent/descent and the gradient profile throughout your journey.

Per-Segment Profile Routing

Roads aren't uniform - a single street might have protected lanes on one section and no infrastructure on another. Our per-segment profiling analyzes infrastructure changes within individual roads:

  • Infrastructure Changes: Where protected lanes start/end mid-road
  • Surface Quality: Transitions between paved and unpaved sections
  • Road Class Changes: When a route transitions between road types

This granular approach ensures routes don't just look at road names, but understand the actual riding experience on every segment - critical for accurate navigation in Victoria's mixed infrastructure network.

What We're Working On

🚧 Elevation Optimization

User preferences for elevation: avoid hills, prefer flat routes, or don't care. Balancing elevation gain with route distance.

🚧 Dynamic Weighting Refinement

Fine-tuning the weight multipliers for each infrastructure type based on real-world user feedback and GPS trace data.

🚧 Real-Time Hazard Routing

Incorporating community-reported hazards, construction, and seasonal conditions into routing decisions to avoid problem areas.