Networks/SUMO Road Networks
| Filename extension | .net.xml |
| Type of content | Map |
| Open format? | Yes |
| SUMO specific? | Yes |
| XML Schema | net_file.xsd |
A SUMO network file describes the traffic-related part of a map. It mainly contains the network of roads/ways, intersections/junctions, and traffic lights in a map (see the figure below). The format is internal to SUMO and reflects continuously SUMO's features. Although being readable (XML) by human beings, a SUMO network file is not meant to be edited by hand. Rather you should use SUMO XML description files together with NETCONVERT. You can also convert an existing map from various formats using NETCONVERT or generate geometrically simple, abstract road maps with NETGEN. You may also use NETEDIT for building own road networks or for reworking the ones obtained from NETCONVERT or NETGEN.
NETGEN allows to create networks in a very comfortable way. For some small-sized tests of rerouting strategies, tls-signals etc., this is probably the best - read "fastest" - solution to get a network one can run some simulations at. The clear naming of the streets also eases defining own routes. But networks generated using NETGEN are of course useless as soon as you want to simulate a real-world network.
Using NETCONVERT one can import road networks from several sources, among them VISUM, shape files, and OSM databases. This is of course the tool to use for setting up real-world networks.
Still, most examples within the data-section were written as XML files by hand and converted using NETCONVERT for several reasons. At first, the examples are small enough and one may steer the output better than when using NETGEN. Furthermore, defining own networks using XML-data is more flexible.
Contents |
Network Format
At a coarse scale, a SUMO network is a directed graph. "Nodes" represent intersections/junctions, and "edges" roads/streets. In addition to this basic structure, a SUMO network contains further traffic related information:
- every street (edge) as a collection of lanes,
- the position, shape and speed limit of every lane,
- the right of way regulation,
- the connections between lanes at junctions (nodes), and
- the position and logic of the traffic lights.
Edges and Lanes
The attributes of an edge are:
- id: The id of the edge
- from: The id of the node it starts at
- to: The id of the node it ends at
- priority: A numerical value showing how important the road is
- function: An abstract edge purpose
For the simulation, only the "function" attribute is of interest. It describes how the edge is used, and whether it is an edge that can be found within the real world or only a helper construct used for assignment, f.e. The following purposes are defined:
- normal: The edge is a plain part of a road network, like a highway or a normal street which connects two roads
- connector: The edge is a macroscopic connector - not a part of the real world road network. Still, within the simulation, no distinction is made between "connector" roads and "normal" nodes. Only SUMO-GUI allows to hide connector edges.
- internal: The edge is a part of an intersection (is located within the intersection). The usage within the simulation differs from the one of normal edges.
Each edge includes the definitions of lanes it consists of. Each lane is defnied by:
- id: The id of the lane
- depart: Information whether vehicles starting on this edge normally use this lane (=1) or not (=0)
- vclasses: The list of vehicle classes allowed/disallowed on this lane
- speed: The maximum velocity allowed on this lane
- length: The length of this lane
Furthermore, a lane contains a shape. Even though the network is shifted to start at (0,0), it is not guaranteed that all of the network's parts have positive coordinates.
Nodes
Some notes:
- It is possible that two different nodes have the same position
Coordinates and alignment
The networks are using cartesian coordinates where the leftmost node is at x=0 and the node being most at the bottom is at y=0. This means that when being imported, NETCONVERT and NETGEN are projecting the network, first, if the original network was not using cartesian coordinates. Then, they move the road network to the origin at (0,0).
This process is documented within the generated network within the element location. You may find here the following attributes:
| Name | Type | Description |
|---|---|---|
| netOffset | offset (<2D-POSITION>) | The offset applied for moving the network to (0,0) |
| convBoundary | boundary (<2D-BOUNDING_BOX>) | The boundary spanning over the nodes of the converted network (the network as now given) |
| origBoundary | boundary (<2D-BOUNDING_BOX>) | The network's initial boundary before projecting and translating it |
| projParameter | projection parameter | Information how the network was projected (see below) |
projParameter may not necessaraly be a proj-string. This is only the case if the network was projected using proj from another coordinate system. The following encodings are currently used:
| Encoding | Description |
|---|---|
| '!' | No projection was applied. |
| '-' | "Simple" projection was applied |
| '.' | ? |
| proj-definition (<PROJ_DEFINITION>) | The projection was done using proj, initialising it using these parameter. |
For obtaining the original coordinates from the x/y-coordinates SUMO reports, one has to subtract the network offset first. Then, one has to apply an inverse transformation of the initial projection, regarding projParameter. For proj-projected networks, one can use proj's function named pj_inv which performs the inverse transformation. proj has to be initialised with the projection parameters from projParameter, first. For proj-projected networks this would look like:
Position2D cartesian = sumoXY(x, y); projPJ myProjection = pj_init_plus(projParameter.c_str()); cartesian.sub(netOffset); projUV p; p.u = cartesian.x(); p.v = cartesian.y(); p = pj_inv(p, myProjection); p.u *= RAD_TO_DEG; p.v *= RAD_TO_DEG; cartesian.set((SUMOReal) p.u, (SUMOReal) p.v);
For networks with no projection (projParameter='!'), only the offset must be applied. For networks with "simple" projection (projParameter='-'), a back-projection method is currently not known.
SUMO road networks are meant to be aligned to the north. Of course, it is up to the user how he defines a road network, but when being imported from sources as Open Street Map or shape files, the up-direction is meant to correspond to north.
Software for Viewing, Editing and Processing
To create a SUMO network file, NETCONVERT helps to generate it from maps in other formats and NETGEN constructs a new map with simple geometries. SUMO performs its simulation directly in the map of this file. Other SUMO tools like duarouter also use this file to generate the demand for the map.
The SUMO net file is not meant for direct editing. Convert it to the SUMO native XML descriptions with NETCONVERT instead. You can then process these files by hand or, for example, with eWorld.
An application for editing the networks named NETEDIT is available for project partners. It is not part of the open source release. Please ask us directly.
Further Documentation
- Network Import
- Generation of abstract road networks
- NETEDIT manual
- Developer/Network Building Process
Please see the ChangeLog when dealing with networks generated by old versions of NETCONVERT / NETGEN.
