Relative Mainline layout reference

Relative Mainline is a schematic layout that processes edges. It can apply to any data referencing lines that are parallel and was originally designed for railroad tracks.

This layout arranges the network diagram features in the active diagram along parallel straight lines, with all the connected edges having the same attribute value. It also places the branches from those lines, preserving their directions regarding the straight lines and the distances proportional to the initial distance and relative to each other.

This algorithm requires network attributes with specific values on the network line classes to identify the edges that compose each straight line and classify each edge so it is prioritized or excluded during the process.

Root flags can be set to specify the starting points of the junctions where the straight lines will start. If no root is set, the algorithm first searches junction candidates to be the root junctions—that is, junctions that are connected to a single edge that can be considered as the starting point for a straight line. Among those candidate junctions, the root junction will be the one that begins the longest straight line.

The examples below show a diagram before and after applying Relative Mainline, respectively:

Before applying the Relative Mainline layout
After applying the Relative Mainline layout

The following examples focus on the portion circled in the examples above before and after the Relative Mainline layout execution:

Zoomed in to the circled portion before applying the Relative Mainline layout
Zoomed in to the circled portion after applying the Relative Mainline layout

Apply the Relative Mainline layout on an active diagram map view

When applying this layout on a network diagram, the following prerequisites must be met:

  • Since this operation is transactional, edits must be saved before it is run.
  • The input network diagram layer to which the layout applies must be from either a utility network or trace network in a file geodatabase, or a network diagram service. When working with a utility network or a trace network in an enterprise geodatabase, the input network diagram layer must be from a service

To apply the Relative Mainline layout on an active diagram map view, choose the Apply Relative Mainline Layout tool in the Geoprocessing pane.

Then, adjust the Relative Mainline layout parameters and click Run.

Note:

To apply the layout on a subset of features in the network diagram, use one of the Select Features tools (for example, Select By Rectangle, Select By Polygon, and so on) and select the diagram features before running.

Configure the Relative Mainline layout on a diagram template

To configure this layout on your diagram template, use the Add Relative Mainline Layout tool.

Relative Mainline layout parameters

The sections below clarify the Relative Mainline diagram layout main parameters

Apply Relative Mainline Layout parameters.

Line Attribute

This parameter is required. It sets the name of the network attribute that will be used to identify and group the edges that comprise the straight lines. This network attribute must exist in the network line classes. Its values should be the same for all the edges that comprise a straight line, for example, Line 1, Line 2, and so on. Edges with missing attribute values will be considered part of a branch.

The examples below show a diagram before and after applying the Relative Mainline layout after specifying only the Line Attribute parameter, with the other attribute parameters not set by default:

Before applying the Relative Mainline layout
After applying the Relative Mainline layout

The example below shows each line with a given color according to its Line Attribute value; the Line Attribute values are also labeled in the image. The algorithm clearly groups the lines with the same attribute value and places each group of lines along the same straight line as far as possible:

Resulting Line Attribute values

Direction

There are two possible directions for the main line:

  • From left to right—The main line is drawn as a horizontal line starting from the left and ending on the right. This is the default.
  • From top to bottom—The main line is drawn as a vertical line starting from the top and ending at the bottom.

The examples below show a diagram laid out using the From left to right and From top to bottom directions, respectively:

Relative Mainline layout applied with Direction set to From left to right
Relative Mainline layout applied with Direction set to From top to bottom

Offset Between Branches

This parameter determines the spacing between two adjacent branches along the axis perpendicular to the direction of the lines, that is, the spacing labeled A in the examples below for which the Relative Mainline layout is executed with Direction set to From left to right:

Relative Mainline—Offset Between Branches

Break Point Angle (in degrees)

This parameter specifies the angle that will be used to position the break point on the branches. It is a value between 30 and 90 degrees that is combined with the Offset Between Branches parameter value to compute this position. When the break point angle value is 90 degrees, each branch displays orthogonally.

The examples below show a diagram laid out using different values for Break Point Angle (in degrees):

Relative Mainline—Break Point Angle (in degrees)

Line Classification

This subsection regroups parameters that allow you to qualify different types of lines. These parameters are optional.

Type Attribute

This parameter sets the name of the network attribute the algorithm uses to qualify each line. This specific network attribute can exist in the network line classes. The network attribute name specified for the Line Attribute and Type Attribute parameters can be the same.

When this parameter is set, you must specify the type attribute values to help the algorithm identify the main lines, the branches, or any lines that must be systematically excluded, for example, crossovers or ladders. To do so, set all or some of the following parameters:

  • Mainline Values—These values are the type attribute values that can be used to distinguish the main lines from the other line types.
  • Branch Values—These type attribute values are those that clearly identify the branches among the other line types.
  • Excluded Values—These type attribute values identify the edges that must be excluded from the straight lines.

The examples below show a diagram after the layout executes with no type attribute values set and with type attribute values specified for the Excluded Values parameter, respectively:

Relative Mainline—Excluded Values

Line Compression

This subsection regroups parameters that can be used to reduce the distances between adjacent groups of neighbor junctions along the direction while maintaining relative positioning between these groups. Neighbor junctions are junctions that are close to each other without necessarily being directly connected. The compression parameters are optional; by default, the algorithm layout works without any compression. When compression is enabled, it executes as an extra step at the end of the algorithm process.

Compression along the direction

Check this option to activate the compression.

There are two compression parameters to specify when compression is activated: Ratio (%) and Minimal Distance.

  • Ratio (%)—The compression ratio is a value between 0 and 100. It applies to each distance (such as D1 and D2 in the example below) that separates two adjacent groups of neighbor junctions (circled in orange below) after subtracting the specified Minimal Distance value, MD below. When Ratio (%) is 100, the distance between each detected junctions group is equal to the minimal distance, MD.
    Relative Mainline—Ratio and Minimal Distance parameters
  • Minimal Distance—The minimal distance is the distance that must be kept between two adjacent groups of neighbor junctions. This distance is also used to group neighbor junctions regarding their projection along the direction axis. Two junctions projected on this axis will belong to the same group when the distance between the two projected points is less than this distance.

The examples below show a diagram after the layout executes with different Ratio (%) parameter values and a fixed Minimal Distance parameter value:

Relative Mainline—Different compression ratios with the same minimal distance

Advanced Options

This subsection regroups some advanced parameters.

Alignment Attribute

This parameter identifies a network attribute whose values are used to resolve ambiguities on lines that are split. For example, your diagram includes the following characteristics:

  • There is a line (shown in blue in the first image below) that is split into two branches (one red and one green).
  • The Line Attribute and Type Attribute values are not relevant on these three lines to decide how to align them; that is, the Line Attribute values are the same for all lines, or they are all different.

In this situation, without specifying the Alignment Attribute parameter, the algorithm places the two branches on both sides of the blue line by default, as shown in the second image below.

Then, if there is another network attribute on the network line classes for which one of the branch lines and the blue line have the same values, this attribute can be specified as the Alignment Attribute value. When it is set, the algorithm uses it to systematically align connected lines that have the same Alignment Attribute values. For this example, the third image shows the Relative Mainline layout result when the blue and green connected edges have the same Alignment Attribute value and this attribute is specified.

Relative Mainline—Alignment Attribute

Initial Distances

The Initial Distances parameter allows you to specify how the algorithm assesses the length of the diagram edges. This length determines the positions of the diagram junctions along the direction. The distances between the connected junctions along the direction are not equidistant; they are relative to each other and depend on the length of the edge that is processed according to the length of the shortest edge.

  • From current edge geometry—The algorithm computes each diagram edge length from its current geometry. This is the default.
  • From attribute edge—The algorithm computes each diagram edge length from a particular network attribute. In this case, select this attribute name in the Length Attribute drop-down list.

Note:

When the algorithm is configured to execute from an attribute edge, the attribute name is mandatory and the specified attribute must exist on all network line classes as a network attribute.

Related topics