Results 1 to 9 of 9

Thread: routingService:didFinishRouteCalculationWithInfo: questions

  1. #1
    Etablierter skobbler
    Join Date
    27.06.2016
    Posts
    30

    routingService:didFinishRouteCalculationWithInfo: questions

    We've noticed some strange behavior from this routing service delegate method.

    When we calculate a route with a single destination very far away, we end up getting two callbacks for this. This is ok, according to the docs this can happen in case routing can start sooner. (Also note that setting waitForCorridorDownload = YES on the routeSettings provided does not seem to have any effect on this, I still get two callbacks).

    The strange part is the responses I receive from these two callbacks.

    Example: Trip from San Francisco to Arizona

    Start location: [37.7874, -122.408]
    Destination: [33.3055, -111.948]


    The first callback:

    Code:
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 178 $ =[ Finished route calculation (viaPointsOnRoute: 0)]=
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 179 $    · Total Distance: 1236756 meters
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 180 $    · Total Estimated Time: 765.6 minutes
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 181 $    · Traffic Delay: 765.6 minutes
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 182 $    · Corridor downloaded: 0
    Note here that the traffic delay is the same as the estimated time of the journey.

    And the 2nd callback happens immediately after:

    Code:
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 178 $ =[ Finished route calculation (viaPointsOnRoute: 0)]=
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 179 $    · Total Distance: 1236756 meters
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 180 $    · Total Estimated Time: 765.6 minutes
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 181 $    · Traffic Delay: 0.0 minutes
    -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 182 $    · Corridor downloaded: 1
    And here, traffic delay is 0. I'm not sure what to make of this.

    Then I add a viaPoint somewhere near my destination:

    Start Location: [37.7874, -122.408])
    Via Point: Starbucks [33.3779, -112.171]
    Destination: [33.3055, -111.948])

    Again, I calculate the route.

    Code:
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 178 $ =[ Finished route calculation (viaPointsOnRoute: 0)]=
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 179 $    · Total Distance: 1211115 meters
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 180 $    · Total Estimated Time: 748.9 minutes
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 181 $    · Traffic Delay: 748.9 minutes
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 182 $    · Corridor downloaded: 0
    Note that this shows that I have no viaPoints on the route, but I did provide one. Also note that the distance & estimated time are less than the first pair of callbacks, leading me to believe this is a callback from point A->B, not A->C.

    Again, I immediately get another callback:

    Code:
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 178 $ =[ Finished route calculation (viaPointsOnRoute: 1)]=
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 179 $    · Total Distance: 39037 meters
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 180 $    · Total Estimated Time: 43.5 minutes
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 181 $    · Traffic Delay: 0.0 minutes
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 182 $    · Corridor downloaded: 1
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 187 $ -----------------------------------------------------
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 188 $    · ViaPointIdentifier: 0
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 189 $    · ViaPoint.estimatedTime: 748.9 minutes
     -[SRCARouteController routingService:didFinishRouteCalculationWithInfo:] line 190 $    · ViaPoint.distance: 1211115 meters
    And again, traffic delay is 0 for the 2nd callback. Some weird behavior here, as the total distance is a small number, seems perhaps the distance from B->C, and the viaPoint defined in this route seems more like the distance from A->B.


    I don't see how I can make sense of these callbacks as they are. Can you please advise if these results are as designed (or is this buggy behavior), and if so, how can I use them in the way they are intended?

    Thanks in advance.
    Last edited by benhyfn; 20.07.2016 at 22:24.

  2. #2
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    Can you please also include the settings you are using when creating the route? (the complete RouteSettings configuration) Are you using the 3.0.0 SDK or the 2.5.1 one?

  3. #3
    Etablierter skobbler
    Join Date
    27.06.2016
    Posts
    30
    Yes, we're using the latest 3.0 release.

    Code:
       SKRouteSettings *routeSettings = [SKRouteSettings routeSettings];
    
        // set the start, destination, and via points....
    
        routeSettings.useLiveTraffic = YES;
        routeSettings.trafficRoutingMode = SKTrafficModeTrafficAndIncidents;
        routeSettings.waitForCorridorDownload = YES;
        [routeSettings setRouteModeByTransportationMode:MapTransportationModeCar];
        
        self.routingService.routingDelegate = self;
        [self.routingService calculateRoute:routeSettings];

  4. #4
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    So that we can test we will need the complete content of routeSettings - so please include also the start, destination and via points (also if you specify the number of alternatives)

  5. #5
    Etablierter skobbler
    Join Date
    27.06.2016
    Posts
    30
    I'm a little confused on what you need. I already gave the start, destination, and viaPoints in the post above.

  6. #6
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    Sorry - my bad (we'll proceed to test)

  7. #7
    Etablierter skobbler
    Join Date
    27.06.2016
    Posts
    30
    Any update on this?

  8. #8
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    No update yet

  9. #9
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    We confirm that we managed to reproduce this issue- the trafficDelay property equal to the estimateTime one and it shouldn't happen this.
    It's an issue at C++ level. We've added it on our internal list of bugs that need to be fixed.

    [Update]:
    As a temporary workaround please consider as valid only the route information arriving with the second callback (when "isCorridorDownloaded" is true).
    With the first callback (when "isCorridorDownloaded" is false) it seems that we receive wrong information about the traffic conditions.
    Last edited by Adela_Silvia; 22.08.2016 at 09:43.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •