Friday, 9 March 2018

Google or similar Map navigation App code Design


Map all the possible routes and intersection points(nodes)
Considering that each route between two nodes is a road. Create a array of roads.


Case 1: no node in between, straight road
Loc1-------road-----------Loc2       


Case 2: multiple nodes


Model:
Class Road:
1 Number of lanes
2 Avg speed during that time(can be calculated according to the number of vehicles passing)
3 Current capacity percentage
Class Node:
1 No of roads connecting
2 Traffic controller to adjust traffic by adding waiting time at node stopage
Class Client Description:
1. LocationWorkLatLong 2. LocationHomeLatLong 3. VehicleAvgSpeed
Computation:
Class RouteFindComputation:
i/p- current LatLong and destination LatLong
Processing internal- number of node to be passed(using shortest distance+waiting time at the each node) shortest distance path
o/p- total distance and time top 2 results (with all the nodes and roads details)
Cache & Storage:
DB for storing roads and nodes with their properties
Store data of mostly travelled nodes for better performance
View:
1.Current location and total time left to reach destination. 2. Forms to fill data - CopyRights HD