----------
Dne 28. listopadu 2018 19:51:46 Greg Troxel <[email protected]> napsal:
I meant where is it is encoded and where does it come from.
On OSMand native routing, it is all stored in the routing.xml file, by
default internally, unless a user explicitly place a file copy in the
OSMand data folder.
If one uses a Brouter as the 3rd party offline routing service in OSMand,
the routing rules are stored in a script-like routing profile file. The
availability and flexibility is far superior to OSMAnd, but note that
Brouter is primarily bicycle and hiking router.
Its car routing was mostly at testing stage, until the author came with
very interesting kinematic car routing algorithm.
But still, for cars are better other solutions.
For shortest-distance, it's obvious.
But shortest distance is hardly useful, as it leads you along roads you
would never choose. Fastest, economic or optimal as trade off are far more
useful.
Is the fastest possible speed encoded as a
constant in the routing profile, or is there some max over all roads in
the map, or is 160 km/hr assumed for car routing regardless, or ?
There is an Openstreetmap tagging for explicit max speed limits,
and default assumptions of nominal speed for particular road class. There
are eventual also penalties for tagged physical conditions.
Meaning if there really is a near-optimal straight road but it's
somewhat out of the way to get to it, 1.4 can lead to a route which does
not use that fast road, and is worse? If so, that makes sense to me.
Heuristic coefficient determines,
how bad is supposed the rest of the particular evaluated route, that was
not evaluated yet,nor even the supposed roads.
1.4 says like there is an estimated average curvature prolonging Factor cca
1.2 multiplied by the average rating Factor also cca 1.2.
Until it comes to evaluation of an ideal straight road,
it a priori thinks it is worse by factor 1.4.
The ideal value of the coefficient for long route
is a trade off between accuracy and calculation speed and us equal to the
average cost per straight line distance.
If e.g the average curvature factor of roads along the route is 1.3 ( you
need to pass in average 130 km to get to destination far 100 km in straight
line ),
And if the average road rating of those roads is 1.4,
than the optimal heuristic coefficient us 1.3*1.4.
The bad luck is, this is a priori unknown and deviations from assumptions grow
for short routes and/or for routes with simple road networks with few
alternatives.
If the coefficient is too high for partial routes,
The OSMand would prefer routes with better roads in at the start to those
with better roads at the end, even if the former are worse in total.
So the general approach is to keep the coefficient conservative.
Let consider an example for coefficient 1.4.
There is straight distance 100 km from A to B.
There are 2 alternative routes to drive.
R1: 60 km with rating 1.5 + 60 km with rating 1.0
R2: 60 km with rating 1.0 + 70 km with rating 1.5
The points between road sections are for both routes 50 km straight line
from B.
Total cost is
R1: 60*1.5 + 60=150
R2: 60 + 70*1.5=165
Preferred is R1 with lower cost.
But when the evaluation of both routes is in progress,
It will be taken
R1: 60*1.5 + 50*1.4=90+70=160
R1: 60 + 50*1.4=130
R2 seems incorrectly better and will be preferred for farther evaluation.
For multiple road segments it may eventually change its mind and return to
the optional route. Or not, if there is above mentioned trend in quality
road placement.
See also
https://github.com/poutnikl/Brouter-profiles/wiki
--
You received this message because you are subscribed to the Google Groups
"Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.