Allow penalties for arbitrary nodes

Author: TheMarexCreated May 24, 2015Updated Jul 5, 2026
LabelsFeature Request

Currently penalties are limited to traffic lights. That is overly restrictive as we could also use it for traffic calming and mini-roundabouts are mentioned in this PR https://github.com/Project-OSRM/osrm-backend/pull/534.

Brain dump on how to do this:

  • Replace bool ExtractionNode::traffic_lights with short ExtractionNode::penalty
  • Adapt graph_loader.cpp to load nodes with penalty > 0 in a separate array
  • Adapt m_traffic_lights in EdgeBasedGraphFactory

Source: Project-OSRM/osrm-backend