Select to view content in your preferred language

divergence between map and Route plan

2452
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
by Anonymous User
Not applicable

Looks like the basemap tiles (which I assume are pre-rendered imagery service) has road lines that are different from the network lines in the network dataset. In essence, you are overlaying two different datasets and noticing the differences.

Just because both datasets seem to be hosted by ESRI doesn't guarantee parity.

0 Kudos
MarekFlorianczyk
Occasional Contributor

Hi,

Kind of hard for me to accept that answer. No matter what map I use provided by ESRI, like BasemapNavigationVector, there is always the same divergence problem, and I know the roads are mapped correctly, I have checked this driving with gps. What is more ESRI has a support for Polish language, thats why I choose it, it has driving directions in Polish language, so it is unlikely that is has network dataset so wrong.

Ha, and a minute ago I have discovered that when i install my app on Android phone and I select very the same route, route line is drawn correctly.

So what the heck is going on?

0 Kudos
FrankKish
Esri Contributor

It looks like the route is being generalized, the world routing service by default has the geometry precision set to 10 meters, but your code explicitly sets this property "routeParameters.travelMode.outputGeometryPrecision=1" so it is unclear as to why the route would be be generalized.  I looked at the examples above, even using the default of 10 m the output route does not have the those those large divergences from the base map.  I had to set the outputGeometryPrecision to 100 and 200 m to get anything similar.

Not sure where you are doing the initial development but if you can capture the web request to the world routing service it should have the values for the outputGeometryPrecision that is being used (and the outputGeometryPrecisionUnits).  That would show what the rest call is actually using for these values.


MarekFlorianczyk
Occasional Contributor

Hi Frank

Thanks for Your attention.

I have attached tcpdump, hope it will help.

Best Regards

Marek

0 Kudos
FrankKish
Esri Contributor

Looking at the tcpdump output the REST call is sending "outputGeometryPrecision = 1000000", this is the reason for the divergence between the map and route.  What I'm not sure about how the REST call has this when code has outputGeometryPrecision=1;

You said "when i install my app on Android phone and I select very the same route, route line is drawn correctly.", exact what is your setup\development environment when you get the problem?

Thanks

MarekFlorianczyk
Occasional Contributor

Hi

My development enviroment is Linux 64Bit with Qt 5.10.1. Debian 9

I have downloaded ArcGIS 100.2.1 and have it installed in:

/opt/arcgis/runtime_sdk/qt100.2.1/
I did not perform integration with Qt Creator I'm only using runtime, so in my .pro file I have:

include(/opt/arcgis/runtime_sdk/qt100.2.1/sdk/ideintegration/arcgis_runtime_qml.pri)_

and in main.cpp there is:
#ifdef Q_OS_LINUX
    engine.addImportPath("/opt/arcgis/runtime_sdk/qt100.2.1/sdk/linux/x64/qml");
#elif defined(Q_OS_ANDROID)
    engine.addImportPath("/opt/arcgis/runtime_sdk/qt100.2.1/sdk/android/armv7/qml/");
#endif

I'm using QML, application has backend written in cpp but regarding ArcGIS all code is in QML.

gcc -v 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc
,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=
posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-obje
ct --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/us
r/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arc
h-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-li
st=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

Best Regards
Marek
0 Kudos
MarekFlorianczyk
Occasional Contributor

This code:

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();
                    console.log("onCreateDefaultParametersStatusChanged travelMode:"+JSON.stringify(routeParameters.travelMode))
                }
            }_

generates debug output:

qml: onCreateDefaultParametersStatusChanged travelMode:{"objectName":"","objectType":"TravelMode","error":null,"objects":{},"attributeParameterValues":{"0":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Avoid Unpaved Roads","parameterName":"Restriction Usage","parameterValue":5},"1":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Avoid Private Roads","parameterName":"Restriction Usage","parameterValue":2},"2":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Driving an Automobile","parameterName":"Restriction Usage","parameterValue":-1},"3":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Through Traffic Prohibited","parameterName":"Restriction Usage","parameterValue":5},"4":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"TravelTime","parameterName":"Vehicle Maximum Speed (km/h)","parameterValue":0},"5":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Roads Under Construction Prohibited","parameterName":"Restriction Usage","parameterValue":-1},"6":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Avoid Gates","parameterName":"Restriction Usage","parameterValue":2},"7":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Avoid Express Lanes","parameterName":"Restriction Usage","parameterValue":-1},"8":{"objectName":"","objectType":"AttributeParameterValue","error":null,"objects":{},"attributeName":"Avoid Carpool Roads","parameterName":"Restriction Usage","parameterValue":-1}},"description":"Models the movement of cars and other similar small automobiles, such as pickup trucks, and finds solutions that optimize travel time. Travel obeys one-way roads, avoids illegal turns, and follows other rules that are specific to cars. When you specify a start time, dynamic travel speeds based on traffic are used where it is available.","distanceAttributeName":"Kilometers","impedanceAttributeName":"TravelTime","name":"Driving Time","outputGeometryPrecision":1,"restrictionAttributeNames":{"0":"Avoid Unpaved Roads","1":"Avoid Private Roads","2":"Driving an Automobile","3":"Through Traffic Prohibited","4":"Roads Under Construction Prohibited","5":"Avoid Gates","6":"Avoid Express Lanes","7":"Avoid Carpool Roads"},"timeAttributeName":"TravelTime","type":"AUTOMOBILE","uTurnPolicy":3,"useHierarchy":true,"objects":{}}

Best,

Marek

0 Kudos
LucasDanzinger
Esri Frequent Contributor

I've tested changing the geometry precision, and changing the precision indeed gives the generalized results like Frank has suggested. I also setup a test app where I change the precision and watch the output http request, and it seems to always reflect what I have set. Can you test to see if when you set the precision if it gets passed through properly in the http request?

0 Kudos
MarekFlorianczyk
Occasional Contributor

Hi

I'm not sure which part of tcpdump I should search in.

I believe this is what I paste down. I can send you full tcpdump from the moment app starts to the moment when route is solved, but I would rather do that to some email address.

Best,

Marek

16:40:17.500845 IP 192.168.132.254.48546 > ec2-18-232-41-248.compute-1.amazonaws.com.http: Flags [P.], seq 2102:2782, ack 7638, win 366, options [nop,nop,TS val 68938797 ecr 11409024],
length 680: HTTP: POST /arcgis/rest/services/World/Route/NAServer/Route_World/solve HTTP/1.1
E.....@.@.........)....P......[l...n.......
...-....POST /arcgis/rest/services/World/Route/NAServer/Route_World/solve HTTP/1.1
Host: route.arcgis.com
User-Agent: ArcGISRuntime-Qt/100.2.1 (debian 9; x86_64; Qt 5.10.1; QML)
referer: lfLgeiHWVTS60dHm
Content-Type: application/x-www-form-urlencoded
Cookie: AGS_ROLES="imRZGn+N3VG9o32gh+AdSHcql/TTN/F4QCyFHp+naJ0Vh26o1ZiqkzhYGkBTUtk3kn0jHstLs4Kf82O4Juk7HyFdfGmMmqEM53kjJs72Nm5EmH7UKCYknMfCRD2Y8F2u4CJFbUBNq/kXwVLeA91OI5GG/UC9jz404XNft4
Ufz/YKbP3pXfVjcNl016i0pzslSQrQHt2GallmOdbLVcXeneOoVFAM4WB6zbudY0mUX55xj2iGVMVZATMa2ZbVoCnsoL1HmRW6gWTOKWZh8WxgLP9QIWyULTbBbE8zILVQMWo="
Content-Length: 3283
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: pl-PL,en,*


16:40:17.501179 IP 192.168.132.254.48546 > ec2-18-232-41-248.compute-1.amazonaws.com.http: Flags [.], seq 2782:4222, ack 7638, win 366, options [nop,nop,TS val 68938797 ecr 11409024], l
ength 1440: HTTP
E.....@.@.........)....P......[l...n.......
...-....f=json&accumulateAttributeNames=Miles%2CKilometers%2CTravelTime&attributeParameterValues=%5B%7B%22attributeName%22%3A%22Avoid Unpaved Roads%22%2C%22parameterName%22%3A%22Restric
tion Usage%22%2C%22value%22%3A5%7D%2C%7B%22attributeName%22%3A%22Avoid Private Roads%22%2C%22parameterName%22%3A%22Restriction Usage%22%2C%22value%22%3A2%7D%2C%7B%22attributeName%22%3A%
22Driving an Automobile%22%2C%22parameterName%22%3A%22Restriction Usage%22%2C%22value%22%3A-1%7D%2C%7B%22attributeName%22%3A%22Through Traffic Prohibited%22%2C%22parameterName%22%3A%22R
estriction Usage%22%2C%22value%22%3A5%7D%2C%7B%22attributeName%22%3A%22TravelTime%22%2C%22parameterName%22%3A%22Vehicle Maximum Speed %28km%2Fh%29%22%2C%22value%22%3A0%7D%2C%7B%22attrib
uteName%22%3A%22Roads Under Construction Prohibited%22%2C%22parameterName%22%3A%22Restriction Usage%22%2C%22value%22%3A-1%7D%2C%7B%22attributeName%22%3A%22Avoid Gates%22%2C%22parameterN
ame%22%3A%22Restriction Usage%22%2C%22value%22%3A2%7D%2C%7B%22attributeName%22%3A%22Avoid Express Lanes%22%2C%22parameterName%22%3A%22Restriction Usage%22%2C%22value%22%3A-1%7D%2C%7B%22
attributeName%22%3A%22Avoid Carpool Roads%22%2C%22parameterName%22%3A%22Restriction Usage%22%2C%22value%22%3A-1%7D%5D&barriers=&directionsLanguage=PL&directionsLengthUnits=esriNAUKilome
ters&directionsOutputType=esriDOTFeatureSets&directionsStyleName=NA Desktop&directionsTimeAttributeName=TravelTime&findBestSequence=false&ignoreInvalidLo
16:40:17.501186 IP 192.168.132.254.48546 > ec2-18-232-41-248.compute-1.amazonaws.com.http: Flags [.], seq 4222:5662, ack 7638, win 366, options [nop,nop,TS val 68938797 ecr 11409024], l
ength 1440: HTTP
E.....@.@.........)....P...G..[l...n.......
...-....cations=true&impedanceAttributeName=TravelTime&outSR=%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D&outputGeometryPrecision=10%2C000000&outputGeometryPrecisionUnits=esriMet
ers&outputLines=esriNAOutputLineTrueShapeWithMeasure&polygonBarriers=&polylineBarriers=&preserveFirstStop=true&preserveLastStop=true&restrictUTurns=esriNFSBAtDeadEndsAndIntersections&re
strictionAttributeNames=Avoid Unpaved Roads%2CAvoid Private Roads%2CDriving an Automobile%2CThrough Traffic Prohibited%2CRoads Under Construction Prohibited%2CAvoid Gates%2CAvoid Expres
s Lanes%2CAvoid Carpool Roads&returnBarriers=false&returnDirections=true&returnPolygonBarriers=false&returnPolylineBarriers=false&returnRoutes=true&returnStops=true&returnZ=false&startT
imeIsUTC=true&stops=%7B%22doNotLocateOnRestrictedElements%22%3Atrue%2C%22features%22%3A%5B%7B%22attributes%22%3A%7B%22CurbApproach%22%3A0%2C%22LocationType%22%3A0%2C%22Name%22%3A%22Orig
in%22%2C%22RouteName%22%3A%22%22%2C%22Sequence%22%3A1%2C%22Status%22%3A0%7D%2C%22geometry%22%3A%7B%22x%22%3A2355617.9410596034%2C%22y%22%3A6836048.9197683297%2C%22spatialReference%22%3A
%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D%2C%7B%22attributes%22%3A%7B%22CurbApproach%22%3A0%2C%22LocationType%22%3A0%2C%22Name%22%3A%22Parkingu%22%2C%22RouteName%22%3A%2
2%22%2C%22Sequence%22%3A2%2C%22Status%22%3A0%7D%2C%22geometry%22%3A%7B%22x%22%3A2355719.0191572439%2C%22y%22%3A6833568.9409978902%2C%22spatialReference%2
16:40:17.661726 IP 192.168.132.254.48546 > ec2-18-232-41-248.compute-1.amazonaws.com.http: Flags [P.], seq 5662:6065, ack 7638, win 366, options [nop,nop,TS val 68938838 ecr 11410247],
length 403: HTTP
E.....@.@.........)....P......[l...n.w.....

...V...G2%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D%5D%2C%22hasZ%22%3Afalse%2C%22type%22%3A%22features%22%7D&timeWindowsAreUTC=true&useHierarchy=true&useTimeWindows=fa
lse&token=QAi0KLtoyTyZSsF4f8reaODc3WY3E24qKooU-KVqFD0B5uQ8jMY5vgI5I16KiaaflgL1mSyFjEEYHFL2VvmmKHYk6O0wFIOWGngspw4pteygtzaLhn_VvnhHNLvRmT3gpeKYxcWUsrjwC9t9nsMHO4JRSnUS_IsH5T_EbXNaaYLYOke
YUwgUv0thwQ4iPCF-Ui-YLJTg5K7gIqG19tqNZw..
16:40:17.991791 IP ec2-18-232-41-248.compute-1.amazonaws.com.http > 192.168.132.254.48546: Flags [.], seq 7638:9078, ack 6065, win 172, options [nop,nop,TS val 11410331 ecr 68938838], l
ength 1440: HTTP: HTTP/1.1 200
E.....@.......)......P....[l...z.....).....
.......VHTTP/1.1 200
Date: Fri, 11 May 2018 14:40:17 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 4787
Connection: keep-alive
Cache-Control: max-age=0,must-revalidate
Server:
Set-Cookie: AGS_ROLES="imRZGn+N3VG9o32gh+AdSHcql/TTN/F4QCyFHp+naJ0Vh26o1ZiqkzhYGkBTUtk3kn0jHstLs4Kf82O4Juk7HyFdfGmMmqEM53kjJs72Nm5EmH7UKCYknMfCRD2Y8F2u4CJFbUBNq/kXwVLeA91OI5GG/UC9jz404X
Nft4Ufz/YKbP3pXfVjcNl016i0pzslSQrQHt2GallmOdbLVcXeneOoVFAM4WB6zbudY0mUX55xj2iGVMVZATMa2ZbVoCnsoL1HmRW6gWTOKWZh8WxgLP9QIWyULTbBbE8zILVQMWo="; Version=1; Max-Age=60; Expires=Fri, 11-May-2
018 14:41:17 GMT; Path=/arcgis/rest; HttpOnly
ETag: 8b3e728a
X-Content-Type-Options: nosniff
Content-Encoding: gzip
Vary: Origin

0 Kudos