[OSRM-talk] profile.lua for railways

Spyou root at spyou.org
Sat Dec 28 18:27:10 UTC 2013


Le 28/12/2013 15:36, Spyou a écrit :
>
> Did anyone done this before or is there any documentation for the
> profile files ?

I've managed to write a dummy version.

If anyone has idea on it, i'll be glad to hear them :)

function way_function (way)
        local railway = way.tags:Find("railway")
        if (railway=='rail') then
                way.speed = 10
                way.direction = Way.bidirectional
                way.type = 1
                return 1
        end
        return 0
end

function turn_function (angle)
        if (angle < -45) or (angle > 45) then return 200 end
        return 0
end




More information about the OSRM-talk mailing list