Location:

Automobile Routing

[Navinfo Navigation SDK for Android] provides three route planning methods, single-route, multi-rule and multi-result, which are provided in the NaviSession.RouteMethod method. The results include five modes of driving route planning, namely "system recommendation", "shortest route", "high speed priority", "shortest time", "least cost" five kinds of calculation rules, and the calculation result may return 1 - 3 routes. The multi-rules contain four rules: "system recommendation", "distance priority", "high-speed priority", and "avoidance charge". The result of the calculation is the four routes corresponding to the return rule. A single route returns a route based on the rules set. The three modes are side-by-side and cannot exist at the same time. At the same time, in these three parallel modes, you can also set the enable "avoid congestion" to calculate the road. The sample code is as follows:

Multi-Results Road Planning

                // Navigation route planning
                mRoutePlan = new RoutePlan();           // Instantiate the route plan
                mRoutePlan.setStartPoint(mStartPoint);  // Set the starting point of the line plan
                mRoutePlan.setEndPoint(mEndPoint);      // Set the line planning end point
                mRoutePlan.setUseTmc(true);             // Set to use Tmc to calculate the way, that is, avoid the congestion calculation
                
                // According to the route planning and using the multi-result method to start the calculation, the return result may be 1-3 routes.
                mNaviSession.getInstance().startRoute(mRoutePlan, NaviSession.RouteMethod.multipleResult);
                // route result returns
            

Multi-rule calculation planning

                // Navigation route planning
                mRoutePlan = new RoutePlan();               // Instantiate the route plan
                mRoutePlan.setStartPoint(mStartPoint);      // Set the starting point of the line plan
                mRoutePlan.setEndPoint(mEndPoint);          // Set the line planning end point
                mRoutePlan.setUseTmc(true);                 // Set to use Tmc to calculate the way, that is, avoid the congestion calculation
                
                // According to the route planning and planning using the multi-rule calculation method, the calculation results are four routes corresponding to "system recommendation", "distance priority", "high speed priority", and "avoidance charge".
                mNaviSession.getInstance().startRoute(mRoutePlan, NaviSession.RouteMethod.multipleRule);
            

Single route calculation plan

                // Navigation route planning
                mRoutePlan = new RoutePlan();           // Instantiate the route plan
                mRoutePlan.setStartPoint(mStartPoint);  // Set the starting point of the line plan
                mRoutePlan.setEndPoint(mEndPoint);      // Set the line planning end point
                mRoutePlan.setRule(RoutePlan.Rule.recommended);     // Set the calculation rule to the system recommendation rule
                mRoutePlan.setUseTmc(true);     // Set to use Tmc to calculate the way, that is, avoid the congestion calculation
                
                // Start planning based on route planning and using a single calculation method, returning a result as a route
                mNaviSession.getInstance().startRoute(mRoutePlan, NaviSession.RouteMethod.single); 
                // Calculate the result of the return
            

The effect is shown below:

TOP