
Marco Certelli <marco_certelli@yahoo.it> writes:
I just would like to keep control over the map generation. For example: in Italy the maxspeed out of the city is 90km/h. It applies to unclassified roads up to trunk roads (well, some trunks has 110 km/h).
I would like to code in the map in a way that a tertiary with 90km/h speed limit gets road_speed 3 (i.e 60 km effective speed), while a trunk with the same 90km/h limit gets road_speed 5 (i.e 90 km/h effective speed). You can immagine for the secondary and primary.
I think the real problem is that maxspeed being a legal maximum is just not the right concept for routing. In ma.us, the rule is that one's speed must be reasonable and proper, and if you are over the posted speed you are deemed not reasonable and proper. But you can't drive that speed if it's not safe. I gather in .it it's similar, but that it's reasonably common to have roads where driving the legal max is unsafe and therefore not allowed. Or are you talking about congestion that is so frequent that the typical experience is below max speed due to that, even though at 0530 you might be able to go maxspeed?
I looked at the source and you coded: if maxspeed>40 then road_speed=3
It means that in the Italian cities (limit=50) the average speed coded in the map is 60km/h. It looks strange to me and carries to very "optimistic" city ETA calculations (and maybe not optimal route selection).
What I think is needed is a new tag "typical_speed" that gives the speed at which traffic tends to move when it is not unusually congested. Something like the median actual speed over many samples spaced reasonably uniformly in time. This can be higher or lower than the limit - this morning on a road posted at 55 mph there was not a single car going less than 75 mph. It might be good to set road_speed to the highest value <= maxspeed, but this is really just kludging around the real problem of a good estimate.
Moreover, I sow other map makers (DE:All_in_one_Garmin_Map) making maps including the maxspeed tag management in their styles (but maybe they use a patched mkgmap).
So, if it counts I do vote for the switch --ignore-maxspeed and I vote to integrate the patch in the mainstream mkgmap (again, I'm not able to compile the code).
It sounds like moving the maxspeed => garmin speed tags rules out of java and into style files is the right thing to do, because then people can make their own ad hoc rules for road type and max speed to estimate the not-yet-present "typical_speed" tag value. But I think we should be clear that what we are doing is taking multiple kinds of data from the database and estimating properties that could be recorded but aren't yet.