1

i'm working with OSRM(Open Source Routing Machine) and ran into some problems. I want configure blocking hours for a specific road(like Grab) Ex: The street called Cau Giay block taxis from 4.00pm to 7.00pm

code detail:

function restrict(way, result)
  -- Check if the way is named contain Cau Giay
  local name = way:get_value_by_key('name')
  if name and string.find(name, 'Cau Giay') then
    -- Add a restriction to the way
    result.restriction = '* @ (Mo-Fr 16:00-19:00)'
  end
end

function way_function(way)
  local result = {
    -- Other routing rules and restrictions go here
  }
  restrict(way, result)
  return result
end

but nothing changed.

please tell me where the above code is wrong and suggest some ways you have done it!

Thanks and best regards!

https://github.com/Project-OSRM/osrm-backend/issues/33 and https://github.com/Project-OSRM/osrm-backend/issues/735

David Maze
  • 130,717
  • 29
  • 175
  • 215
the rocket
  • 11
  • 2
  • `* @ (Mo-Fr 16:00-19:00)` looks wrong to me according to [conditional restriction tagging](https://wiki.openstreetmap.org/wiki/Conditional_restrictions). Shouldn't it be `no @ (Mo-Fr 16:00-19:00)` instead? I'm not familiar with OSRM internals, though. I have no idea if conditional access restrictions already work correctly ([ticket #4231](https://github.com/Project-OSRM/osrm-backend/issues/4231) is still open). – scai Jan 09 '23 at 10:23

0 Answers0