Road speeds

55 views
Skip to first unread message

mari.ma...@gmail.com

unread,
Aug 16, 2012, 7:04:12 AM8/16/12
to monav-...@googlegroups.com
Hi!


All roads in my dataset have maxspeed tag set. So I assumed, that all speed data
is taken from that tag and speeds in speed profile are not taken into account at all.

For testing purposes, I set
maxSpeed=1000
defaultCitySpeed=1000
averageSpeed=1000
for some road types. It seems, that speed profile data ise used instead of maxspeed
tag.

So my question is - how are maxspeed tag and maxSpeed, averageSpeed
and defaultCitySpeed values in speed profile used?


Second question - how does road priority (i.e. highway.0.priority=4) affect routing 
result? From old-school point of view, algorithm tries to find quickest way, based
on ride time for edge (calculated from speed and road length). For priorities,
speeds were multiplied by constant (eg. 1.5 for higher and 0.5 for lower priorities).


Best regards


Christian Vetter

unread,
Aug 16, 2012, 7:42:19 AM8/16/12
to monav-...@googlegroups.com
Hi,

Regarding your first question:

Speed calculation in MoNav is as follows:

1. Determine "Max Speed":
- if given in the map use that one, but limit to maxSpeed ( e.g.
Pedestrian could be limited to 6kmh )
- otherwise derive from road type and "in-city" flag, either
defaultCitySpeed or maxSpeed
2. Compute average speed as percentage of "Max Speed", depending on road type
3. Apply modifiers

So in your case, you would use the max_speed from the map ( it is
smaller than 1000 ), but compute the average speed as 1000% of the max
speed, since it is given in percents.
Could you try setting averageSpeed to 100 ( or leave it on the default
values ) if you want to test whether your speeds are used?

Also, the maxspeed tag needs to be well formed, i.e., it needs to be a
floating point number followed by one of the following strings:
"kmh"
" kmh"
"km/h"
" km/h"
"kph"
" kph"
"mph"
" mph"
"" -> will be mapped to kmh

Regarding the second question:
The priority is only used to calculate turn costs, e.g. if you cross a
road of lower priority it will take longer.

The routing algorithm itself doesn't try to "cheat", by preferring
higher priority roads even if they are slower ( typical A* in
commercial application will do that, gives you a speed boost but not
the optimal result ), since it is capable of computing the optimal
route without any performance loss.
You could say, that MoNav optimizes for time ( length / average speed
+ turn cost ) only, so you will always get the fastest route possible.

I hope that answers your questions *G*

Best regards,

Christian Vetter

mari.ma...@gmail.com

unread,
Aug 21, 2012, 9:31:18 AM8/21/12
to monav-...@googlegroups.com, mari.ma...@gmail.com

Hi Christian,

thanks for thorough explanation! Everything is clear now, expect for one detail:

>  Determine "Max Speed": 
> - if given in the map use that one, but limit to maxSpeed ( e.g. Pedestrian could be limited to 6kmh )  

What is that "maxSpeed" - is it max speed for given road type from speed profile, or some configuration 
variable, that I haven't discovered yet?

I'm making really good progress with MoNav now, and I would appreciate explanation on following
.spp variables:


otherLeftPenalty
otherRightPenalty
otherStraightPenalty
otherLeftEqual
otherRightEqual
otherStraightEqual
leftPenalty
rightPenalty


Best regards

Christian Vetter

unread,
Aug 24, 2012, 2:41:15 AM8/24/12
to monav-...@googlegroups.com, mari.ma...@gmail.com
Hi,

"maxSpeed" is the speed from the profile. This way you can create a
profile for "vehicles" ( bicycle, pedestrian ), that cannot exceed a
certain speed limit.

Regarding the penalty values: Their are used to compute turn costs,
otherXXX are applied of you have a junction with other streets of
lower priority, and you turn left, right, or go straight.
otherXXXEqual are applied if you have a junction with other streets of
equal priority. leftPenalty/rightPenalty are base penalties for
turning left / right.
However, these turn costs are currently not being used by the routing
engine, mainly for storage space reasons ( would increase size of the
routing graph by a factor of 2 or so ), so you can safely ignore them
for now.

Best regards,

Christian

mari.ma...@gmail.com

unread,
Aug 27, 2012, 7:38:26 AM8/27/12
to monav-...@googlegroups.com, mari.ma...@gmail.com

Thanks again!
Reply all
Reply to author
Forward
0 new messages