12.11 Junction elevation grid
Elevation grids provide and overwrite elevation definitions for every point inside the junction boundary. Elevation grids solve the issue of connecting roads with different z-values and gaps. If a lane height (see Section 11.6.3, "Lane height") is present, the values are superimposed onto the grid values in order to model sidewalks etc.
An elevation grid is a coarse square grid with z-values at evenly spaced points. Elevation grids do not replace ASAM OpenCRG.
An elevation grid requires the definition of complete squares outside the junction boundary in each direction.
The minimal elevation grid consists of four points with a z-value forming a square bounding box around the junction boundary. This minimal elevation grid provides a plane with constant height, if the four points have the same z-value.

Figure 98 shows a junction reference line and an elevation grid with the center points C0,0 and C1,0 on the junction reference line and the points R0,0 and R1,0 right to it.
An elevation grid consisting of more smaller squares has a higher resolution and can define more complex elevation profiles.

Figure 99 shows a junction reference line and an elevation grid with points to the left and right of the junction reference line.
Elements in UML model
<elevationGrid>
element
In ASAM OpenDRIVE, elevation grids are represented by the <elevationGrid>
element within the <junction>
element.
UML class: t_junction_elevationGrid XML tag: <elevationGrid> (Multiplicity: 0..1) Introduced: 1.8.0
An elevation grid is a coarse square grid with z-values at evenly spaced points. Elevation grids do not replace OpenCRG.
Name | Type | Use | Unit | Introduced |
---|---|---|---|---|
|
required |
m |
1.8.0 |
|
|
required |
m |
1.8.0 |
<elevation>
element
In ASAM OpenDRIVE, z-values at distinct points to the left or the right of the junction reference line or directly on the junction reference line are represented by <elevation>
elements within the <elevationGrid>
element.
UML class: t_junction_elevationGrid_elevation XML tag: <elevation> (Multiplicity: 0..*) Introduced: 1.8.0
Defines the z-values at the regular grid points along the junction reference line.
Name | Type | Use | Unit | Introduced | Description |
---|---|---|---|---|---|
|
t_junction_grid_position_list |
required |
m |
1.8.0 |
List of defined z-values. |
|
t_junction_grid_position_list |
optional |
m |
1.8.0 |
List of defined z-values from inside to outside. |
|
t_junction_grid_position_list |
optional |
m |
1.8.0 |
List of defined z-values from inside to outside. |
XML example
<junction>
<elevationGrid sStart="1.35191514000e+00" gridSpacing="4.000000000e+00">
<elevation left="5.0" center="5.0" right="5.0 5.0"/>
<elevation left="5.0 5.0" center="5.0" right="5.0 5.0"/>
<elevation left="5.0 5.0" center="5.0" right="5.0 5.0 5.0"/>
<elevation left="5.0 5.0" center="5.0" right="5.0 5.0 5.0"/>
<elevation left="5.05 5.0" center="5.1" right="5.05 5.0 5.0"/>
<elevation left="5.1 5.0" center="5.2" right="5.1 5.0 5.0"/>
<elevation left="5.05 5.0" center="5.1" right="5.05 5.0 5.0"/>
<elevation left="5.0 5.0" center="5.0" right="5.0 5.0 5.0"/>
<elevation center="5.0" right="5.0 5.0 5.0"/>
</elevationGrid>
</junction>
Rules
The following rules apply to elevation grids:
-
Elevation grids are currently only valid for common junctions.
-
asam.net:xodr:1.8.0:junctions.elevation_grid.only_one_elev_grid: A junction shall have only one elevation grid.
-
asam.net:xodr:1.8.0:junctions.elevation_grid.valid_for_entire_boundry: If a junction boundary is defined, the elevation grid shall be valid for the area enclosed by the junction boundary.
-
asam.net:xodr:1.8.0:junctions.elevation_grid.perpendicular_vectors: The elevation grid shall be defined with vectors perpendicular to the junction reference line.
-
The elevation grid shall be valid from the point where a traffic participant enters the junction boundary until it leaves the junction boundary on an outgoing road.
-
The elevation grid outside the junction boundary is overwritten by a road passing the elevation grid. This does not apply to connecting roads, because they are inside the junction boundary.
-
If an elevation grid is present it shall override any elevation values derived from any roads that are part of the junction or its boundary.
-
If a lane height is present, the values are superimposed onto the grid values.
-
asam.net:xodr:1.8.0:junctions.elevation_grid.entry_exit_smoothness: For junction entries and exits, a smooth transition should be assured.
Related topics
12.11.1 Interpolation in the elevation grid
The z-values inside the junction boundary are calculated by bicubic interpolation.

Figure 99 shows an elevation grid with point P.
-
Identify the corner points of the square around P and the points around these corner points.
Square around P: C3,0, R3,0, R4,0, C4,0.
Points around the square: L2,0, C2,0, R2,0, R2,1, R3,1, R4,1, R5,1, R5,0, C5,0, L5,0, L4,0, L3,0.Figure 101. Points around P relevant for interpolations -
Calculate the cubic polynom \(f(x) = dx^{3} + cx^{2} + bx + a\) through the points along each edge.
Use the value
0
for the coefficients \(c\) and \(d\) of the polynoms if there are not enough support points in the elevation grid to calculate them.Figure 102. Tangents and cubic splines relevant for interpolation -
Calculate the (mixed) partial derivative of the cubic polynoms at each point in s-, t-, and st-direction.
-
Apply a bicubic interpolation using the tangents and the cubic polynoms to calculate the z-value of P.
Calculation
Scale and shift the points C3,0, C4,0, R3,0, R4,0 to get the normalized points \((0,0,z_{C_{3,0}}), (1,0,z_{C_{4,0}}), (0,1,z_{R_{3,0}}), (1,1,z_{R_{4,0}})\) for the calculation.
The calculation of the z-value at P uses the following parts:
-
The matrix \(Z\)
\[\begin{align*} Z=\begin{bmatrix} z_{C_{3,0}} & z_{C_{4,0}}\\ z_{R_{3,0}} & z_{R_{4,0}} \end{bmatrix} \end{align*}\]where
\(z_{C_{3,0}}\)
is the z-value at C3,0
\(z_{C_{4,0}}\)
is the z-value at C4,0
\(z_{R_{3,0}}\)
is the z-value at R3,0
\(z_{R_{4,0}}\)
is the z-value at R4,0
-
The matrix \(T_{t}\) of the tangents in t-direction:
\[\begin{align*} T_{t}=\begin{bmatrix} T_{t}(C_{3,0}) & T_{t}(C_{4,0})\\ T_{t}(R_{3,0}) & T_{t}(R_{4,0}) \end{bmatrix} \end{align*}\] -
The matrix \(T_{s}\) of the tangents in s-direction:
\[\begin{align*} T_{s}=\begin{bmatrix} T_{s}(C_{3,0}) & T_{s}(C_{4,0})\\ T_{s}(R_{3,0}) & T_{s}(R_{4,0}) \end{bmatrix} \end{align*}\] -
The matrix \(T_{st}\) of the tangents in st-direction:
\[\begin{align*} T_{st}=\begin{bmatrix} T_{st}(C_{3,0}) & T_{st}(C_{4,0})\\ T_{st}(R_{3,0}) & T_{st}(R_{4,0}) \end{bmatrix} \end{align*}\] -
The constant matrix \(A\):
\[\begin{align*} A=\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0\\ -3 & 3 & -2 & -1\\ 2 & -2 & 1 & 1\\ \end{bmatrix} \end{align*}\] -
The constant \(\alpha\) for the interpolation inside the same square:
\[\begin{align*} \alpha = A⋅ \begin{bmatrix} Z & T_{t}\\ T_{s} & T_{st}\\ \end{bmatrix} ⋅ A^{T} \end{align*}\]
Scale and shift s/t coordinates of point P according to the scale and shift used for the square.
The z-value at scaled and shifted s/t coordinates calculates as:
Rules
-
asam.net:xodr:1.8.0:junctions.elevation_grid.polynome_coefficient_values: The coefficients \(c\) and \(d\) of the polynoms shall be
0
if there are not enough support points in the elevation grid to calculate them.
12.11.2 Interpolation between incoming road and elevation grid
In order to get the smoothest possible transition from an incoming road to the elevation grid of a junction, a four-sided polygon serves as transition area wherein a cubic interpolation defines the elevation values.
The four sides of the polygon are derived from the segment element with @type="joint" of the junction boundary at the incoming road and the two segment elements with @type="lane" next to it.

The first side of the polygon corresponds to a line along the segment element with @type="joint": P0 to P1. The second and third side of the polygon corresponds to the line between an endpoint of the first side and the point on the segment element with @type="lane" in the distance of the @transitionLength attribute of the segment element with @type="joint" along the corresponding segment element with @type="lane": P1 to P2 and P0 to P3. The fourth side of the polygon is the line between the endpoints of the second and third sides: P2 to P3.

-
Solve the following equations to calculate \(k\) and \(l\) and finally the points \(A\) and \(B\).
\[\begin{align*} A= P_{0} + k ⋅ (P_{1} - P_{0}) \end{align*}\]\[\begin{align*} B= P_{3} + k ⋅ (P_{2} - P_{3}) \end{align*}\]\[\begin{align*} P= A + l ⋅ (B - A) \end{align*}\] -
Replace \(A\) and \(B\).
\[\begin{align*} P= P_{0} + k ⋅ (P_{1} - P_{0}) + l ⋅ (P_{3} + k ⋅ (P_{2} - P_{3}) - (P_{0} + k ⋅ (P_{1} - P_{0}))) \end{align*}\]\[\begin{align*} P= P_{0} + k ⋅ (P_{1} - P_{0}) + l ⋅ (P_{3} - P_{0}) + k ⋅ l ⋅ (P_{2} - P_{3} - P_{1} + P_{0}) \end{align*}\] -
Rearrange the equation to set one side to
0
.\[\begin{align*} k ⋅ l ⋅ (P_{2} - P_{3} - P_{1} + P_{0}) + k ⋅ (P_{1} - P_{0}) + l ⋅ (P_{3} - P_{0}) + (P_{0} - P) = 0 \end{align*}\] -
Make the following replacements to get two equations for x and y coordinates.
\[\begin{align*} \begin{matrix} with: & m = px_{2} - px_{3} - px_{1} + px_{0} & n = px_{1} - px_{0} & o = px_{3} - px_{0} & p = px_{0} - px\\ & q = py_{2} - py_{3} - py_{1} + py_{0} & r = py_{1} - py_{0} & s = py_{3} - py_{0} & t = py_{0} - py \end{matrix} \end{align*}\]Result:
\[\begin{align*} \begin{matrix} f_{x}(k, l) & := & m ⋅ k ⋅ l & + & n ⋅ k & + & o ⋅ l & + & p & = & 0\\ f_{y}(k, l) & := & q ⋅ k ⋅ l & + & r ⋅ k & + & s ⋅ l & + & t & = & 0 \end{matrix} \end{align*}\] -
Solve the equations for the variables \(k\) and \(l\).
-
Calculate the points \(A\) and \(B\). For point \(A\), the \(z_{A}\) value and the gradient \(m_{A}\) are calculated at the end of the incoming road. For point \(B\), the \(z_{B}\) value and the gradient \(m_{A}\) in the direction of vector \(AB\) are calculated from the elevation grid.
-
Normalize the gradients \(m_{A}\) and \(m_{B}\) by dividing them by the length of vector \(AB\).
-
Calculate the coefficients for a cubic interpolation.
\[\begin{align*} \begin{matrix} a = & z_{A}\\ b = & & & & & m_{A}\\ c = & -3 ⋅ z_{A} & + & 3 ⋅ z_{B} & - & 2 ⋅ m_{A} & - & m_{B}\\ d = & 2 ⋅ z_{A} & - & 2 ⋅ z_{B} & + & m_{A} & + & m_{B} \end{matrix} \end{align*}\] -
Calculate \(z\) at point \(P\).
\[\begin{align*} \begin{matrix} z_{P} (l) = a + b ⋅ l + c ⋅ l^{2} + d ⋅ l^{3} & with & l = [0..1] \end{matrix} \end{align*}\]