Route Finding
The Route Finding feature provides traffic-aware route calculations with real-time adjustments based on Poway’s traffic dataset. Users can find optimal routes between any two locations with support for multiple travel modes.Overview
Route estimates are dynamically adjusted using real traffic data from Poway’s dataset, providing accurate travel time predictions that account for current road conditions.How to Use
Enter Origin Location
Input your starting point in the Origin field. This can be an address, intersection, or landmark.
Select Travel Mode
Choose your preferred mode of transportation:
- Driving - Car routes with traffic adjustments
- Walking - Pedestrian paths
- Bicycling - Bike-friendly routes
- Transit - Public transportation options
API Integration
The route finder uses the following API endpoint:Request Format
Request Parameters
| Parameter | Type | Description |
|---|---|---|
origin | string | Starting location |
destination | string | End destination |
mode | string | Travel mode: driving, walking, bicycling, or transit |
Map Visualization
Routes are displayed on an interactive Leaflet map with the following features:Automatic Centering
Map automatically centers on your current location using geolocation
Route Highlighting
Primary route shown in blue, alternative routes in gray
Polyline Decoding
Routes rendered using encoded polyline geometry
Bounds Fitting
Map view adjusts to show entire route
Map Initialization
The default map center is set to coordinates [32.7157, -117.1611] with a zoom level of 12, which centers on the Poway area.
Geolocation Support
The map automatically detects your current location:Route Display
When routes are returned, they are processed and displayed:Response Structure
Each route contains:total_distance- Total route distancetotal_duration- Base estimated timetraffic_adjusted_duration- Time adjusted for current trafficdetails- Array of step-by-step instructionsgeometry- Encoded polyline for map rendering
Polyline Rendering
Routes are drawn on the map using decoded polyline geometry:The first route (index 0) is highlighted in blue and the map automatically zooms to fit its bounds. Alternative routes are shown in gray.
Error Handling
The system includes validation and error handling:Traffic-Aware Features
How Traffic Adjustment Works
How Traffic Adjustment Works
Routes are calculated with base duration times, then adjusted using real-time traffic data from Poway’s dataset. The
traffic_adjusted_duration field provides the most accurate estimate of actual travel time.Route Comparison
Route Comparison
Multiple routes are returned for each query, allowing users to compare:
- Different paths to the same destination
- Traffic conditions on each route
- Total distance vs. time trade-offs