The detection of lane layout in the surroundings of the ego-vehicle is a key issue for modern ADAS and autonomous driving. Most modern systems rely on annotated spatial maps to provide lane information. However, these maps are not available everywhere, and thus have to be often supported by direct detection systems (e.g. cameras, lasers). Such systems detect lane boundaries by directly observing lane markings or sensing curbstones and pavements. However, well defined boundaries are not always there, or they can be difficult to detect, especially in rural or inner city roads. Furthermore, other traffic participants in the surroundings can significantly limit the field of view of the ego-vehicle. In order to help lane detection in this kind of scenario, indirect cues, such as the behavior of the other vehicles, can be a useful resource. In this paper we propose a grid-based approach, that works on a road terrain representation and assigns a lane and a driving direction to each patch of road. Our approach segments the road terrain into multiple lanes based on geometrical considerations and prior knowledge, and then assigns a driving direction to each lane, taking into account the observed and predicted motion of the other vehicles in the scene. The road terrain is provided by a system we proposed in a previous work, which combines direct and indirect cues to build a probabilistic road representation grid. This new approach constitutes an additional layer to our representation, providing more awareness about the road regulations to motion control systems and allowing them to plan safer trajectories.