Hi Fernando,

> I've always wondered if there are any plans taking surface
> type/quality into account in the default profiles. I live in a
> developing country (Brazil) with poorly maintained roads and these
> conditions make a big difference at the beginning and at the end of
> many routes if ignored.

I do not know about the plans regarding the default profile, but I
successfully used a simple "factor approach" to surfaces when doing
our routing on bicycle paths here in Denmark.
For instance setting the following in the LUA profile:

-- How much does speed depreciate by surface
surface_factors = {
["unpaved"] = 0.8,
["gravel"] = 0.8,
["cobblestone"] = 0.8,
["dirt"] = 0.8,
["earth"] = 0.8,
["sand"] = 0.8,
["cobblestone:flattened"] = 0.9,
["compacted"] = 0.9,
["fine_gravel"] = 0.9,
["wood"] = 0.9
}

and then later adjuste the speed accordingly:

-- Surface tag
local surfacetag = way.tags:Find("surface")

-- Surface factor
if surface_factors[surfacetag] then
way.speed = way.speed * surface_factors[surfacetag]
way.backward_speed = way.backward_speed * surface_factors[surfacetag]
end



Best regards,

Greg



Hans Gregers Petersen
Partner, Senior Consultant
www.septima.dk

_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to