public boolean outgoingEdgesAreSlowerByFactor ( double factor ) { double tmpSpeed = getSpeed ( currentEdge ) ; double pathSpeed = getSpeed ( prevEdge ) ; // Speed-Change on the path indicates, that we change road types, show instruction if ( pathSpeed != tmpSpeed || pathSpeed < 1 ) { return false ; } double maxSurroundingSpeed = - 1 ; for ( EdgeIteratorState edge : allOutgoingEdges ) { tmpSpeed = getSpeed ( edge ) ; if ( tmpSpeed < 1 ) { // This might happen for the DataFlagEncoder, might create unnecessary turn instructions return false ; } if ( tmpSpeed > maxSurroundingSpeed ) { maxSurroundingSpeed = tmpSpeed ; } } // Surrounding streets need to be slower by a factor return maxSurroundingSpeed * factor < pathSpeed ; }
Checks if the outgoing edges are slower by the provided factor . If they are this indicates that we are staying on the prominent street that one would follow anyway .