I would start with a grid of related nodes. A node will be a change in the state of the road, for example, an intersection, a start or end lane, an extension of the road itself, etc. Either you make complex connections that store all the information (lanes in both directions: how many lanes in the direction? Lane, etc.) or you save one connection for each lane. To make sure that 2 connections on opposite sides of a node are connected to the same strip, you can use node-based lane identifiers.
Thus, you have a graph on which you can run calculations, and you have all the data to visualize the entire network.
source
share