Select to view content in your preferred language

divergence between map and Route plan

2866
11
05-03-2018 08:03 AM
MarekFlorianczyk
Occasional Contributor
Hi

I'm working on a navigation app. I have noticed that sometimes there is a divergence between the map and Route plan. Clearly, you can see this in attached pictures, can someone shed some light why this is happening?

My QML code:

RouteTask {
            id: routeTaskOnline
            url: "http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World"
            Credential {
                oAuthClientInfo:oAuth
            }

            onLoadStatusChanged: {
                if (loadStatus === Enums.LoadStatusLoaded) {
                    console.log("Route task ready");
                    routeTaskOnline.createDefaultParameters();
                }
            }

            onCreateDefaultParametersStatusChanged: {
                if (createDefaultParametersStatus === Enums.TaskStatusCompleted) {
                    routeParameters = createDefaultParametersResult;
                    routeParameters.returnRoutes = true;
                    routeParameters.returnDirections = true;
                    routeParameters.directionsDistanceUnits=Enums.UnitSystemMetric;
                    routeParameters.directionsLanguage="PL"
                    routeParameters.travelMode.outputGeometryPrecision=1;
                    routeParameters.outputSpatialReference = SpatialReference.createWebMercator();
                }
            }

            onErrorChanged: {
                console.log("Route Error:", JSON.stringify(routeTaskOnline.error));
            }
            onSolveRouteStatusChanged: {
                if (solveRouteStatus === Enums.TaskStatusCompleted && solveRouteResult) {

                    for (var index = 0; index < solveRouteResult.routes.length; index++) {
                        console.log("add route graphics idx:"+index)
                        route = solveRouteResult.routes[index];
                        routeGraph = ArcGISRuntimeEnvironment.createObject("Graphic", {geometry: route.routeGeometry});
                        routeGraph.attributes.insertAttribute("route",1);
                        graphicsOverlay.graphics.append(routeGraph);
                        directionListModel = route.directionManeuvers;
                    }
                }
                else if (solveRouteStatus === Enums.TaskStatusErrored) {
                    console.log("Route error");
                }
            }
            Component.onCompleted: {
                routeTaskOnline.load();
            }
}

Pictures:

Best Regards

Marek

Tags (1)
0 Kudos
11 Replies
LucasDanzinger
Esri Frequent Contributor

Can you please contact Esri Support with your repro app? I think they will be able to help troubleshoot different scenarios further and hopefully come to a resolution. One thing I am suspicious of is if there is some issue with separator , vs . as those differ between U.S. and Polish/other locales on the various operating systems. Somehow your geometry precision is going from 1 to  1000000, and that is the cause of the generalized lines - I am just not sure how the number is changing.

0 Kudos
MarekFlorianczyk
Occasional Contributor

Hi

Yes I had an issue with this separator myself, functions needs to be Locale Aware.

On the other hand I have switched default application locale to en_EN - didn't help.

What Esri Support do you have in mind ? Support in my country ?

Not good  only for ArcGIS desktop applications.

This issue is not critical for me, I'm developing on Linux but endproduct with navigation will run on Android and iOS, so as long as these works fine I can sleep peacefully.

Best,
Marek

0 Kudos