The MAP program is responsible for handling location-based services, including routing, traffic estimation, energy consumption, and cost calculations. It will be developed under the map-hub repository, following the same microservice architecture as Snapp.
Its outputs will be used by other programs (Snapp for ride pricing and Food for delivery routes).
-
Shortest Route Calculation → Given origin and destination, return the best route.
-
Traffic Modeling → Estimate traffic conditions dynamically based on usage data (number of active vehicles using Snapp/Food).
-
Energy Consumption Estimation → Predict energy/fuel usage considering distance, slope, and traffic.
-
ETA & Pricing Support → Provide estimated travel time and support Snapp in fare calculation.
Goal: Deliver a simple but functional version quickly.
-
Basic Routing
-
Given start & end coordinates, return a simple path.
-
For MVP, use a simplified graph representation (nodes = intersections, edges = roads).
-
Return distance and estimated time (using average fixed speed).
-
-
Mock Energy Calculation
-
Assume a fixed consumption rate per km.
-
Return approximate fuel/energy usage.
-
-
Basic API Endpoints
POST /route→ Input: origin, destination → Output: route (list of points), distance, ETA, energy.
✅ At the end of Phase 1, Snapp can request a route and pricing support with standard but mocked results.
Goal: Make routing more realistic.
-
Traffic Model
-
Collect the number of active vehicles from Snapp (via API or message broker).
-
Define traffic density rules (e.g., >100 vehicles in area = slower speed).
-
-
Dynamic ETA
-
Adjust travel time according to traffic.
-
Update routes with slow/medium/heavy traffic categories.
-
-
API Update
- Return ETA and adjusted route cost based on live traffic.
Goal: Improve realism of energy/fuel calculation.
-
Slope-aware Calculation
-
Add elevation data to routes (can be mocked for MVP).
-
Energy consumption increases on uphill slopes, decreases on downhill.
-
-
Traffic-aware Energy Use
- Higher energy consumption in heavy traffic (idling, stop-go).
-
Vehicle Type Profiles
-
Different models for car, motorcycle, cargo van.
-
Each has different base consumption rates.
-
Goal: Deliver production-quality map features.
-
Shortest vs Fastest Route
-
Allow user to choose between minimizing distance or time.
-
Implement algorithms like Dijkstra / A Search*.
-
-
Alternative Routes
- Provide multiple possible routes with trade-offs (shorter but more traffic, longer but faster).
-
Scalability
-
Cache frequently requested routes.
-
Optimize graph storage and queries.
-
Goal: Complete professional integration with the rest of the ecosystem.
-
Integration with Snapp
-
Provide real-time routes, ETA, and pricing support.
-
Feed Snapp traffic data to improve matching drivers ↔ passengers.
-
-
Integration with Food
- Provide delivery optimization for multiple stops (restaurant → multiple customers).
-
Analytics & Reports
-
Store historical traffic data.
-
Generate insights like busiest areas, peak hours.
-
- Phase 1 (MVP) must be implemented first → basic route, ETA, and energy.
- Phase 2–3 introduce realism (traffic + energy models).
- Phase 4–5 add professional-level features for optimization and integration.