Apply Compression Layout (Network Diagram)

Summary

Compresses the diagram features toward the middle of the diagram.

Learn more about the Compression layout algorithm

Caution:

If you have an open edit session, you must save your edits prior to running this tool. This ensures that the diagram reflects the latest changes made to the network topology in the database. If you fail to save your edits, the edits will not be reflected in the diagram.

Note:

Each layout algorithm includes default parameter values. The default parameter values will be used unless otherwise specified. If the input network diagram is based on a template for which this layout has been configured with a different parameter value, that value will be used instead.

Usage

  • This tool is not supported when working with a database connection to a utility network or trace network in an enterprise geodatabase. You must use either the related published utility network or trace network service, or a utility network or trace network in a file or mobile geodatabase.

  • The input network diagram layer must be from either a utility network or a trace network in a file or mobile geodatabase or a network diagram service.

  • This layout algorithm compresses the diagram features toward the middle of the diagram while trying to maintain relative positioning. It works from a distance that allows it to build junction groups that are moved as super nodes during the algorithm execution.

  • This algorithm is useful for networks that span thousands of miles and are otherwise difficult to view and understand in their true geographic positions—for example, in the transmission utilities industry.

  • It is typically used on diagrams with containers so the features in the containers are processed as junction groups.

  • Consider applying the layout in asynchronous mode on the server when working on very large diagrams.

Parameters

LabelExplanationData Type
Input Network Diagram Layer

The network diagram to which the layout will be applied.

Diagram Layer
Preserve container layout
(Optional)

Specifies how containers will be processed by the Compression layout algorithm.

  • Checked—The Compression layout algorithm will execute on the top graph of the diagram so containers are preserved. This is the default.
  • Unchecked—The Compression layout algorithm will execute on both content and noncontent features in the diagram.

Boolean
Maximum Distance for Grouping
(Optional)

The grouping distance is used to determine whether two connected junctions are close enough to be considered part of the same junctions group. A junctions group represents many junctions that are moved as a group during execution. The group can contain both junctions and containers. To group two junctions, they must also be connected in the diagram by an edge. The default is 20 units in the diagram's coordinate system.

Linear Unit
Vertex Removal Rule
(Optional)

Specifies which vertices along edges in the diagram will be removed.

  • All verticesAll vertices on all edges will be removed from the diagram.
  • All outer verticesAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, a vertex is added at the intersection of the edge and container polygon. This is the default.
  • All outer vertices except the first oneAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, the first (or last) outside vertex is preserved on edges that intersect a container polygon. A vertex is automatically inserted at the intersection of the edges and container polygons.
String
Run in asynchronous mode on the server
(Optional)

Specifies whether the layout algorithm will run asynchronously or synchronously on the server.

  • Checked—The layout algorithm will run asynchronously on the server. This option dedicates server resources to run the layout algorithm with a longer time-out. Running asynchronously is recommended when executing layouts that are time consuming and may exceed the server time-out (for example, Partial Overlapping Edges) and applying to large diagrams (more than 25,000 features).
  • Unchecked—The layout algorithm will run synchronously on the server. It can fail without completion if its execution exceeds the service default time-out value of 600 seconds. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Output Network Diagram

The updated network diagram layer.

Diagram Layer

arcpy.nd.ApplyCompressionLayout(in_network_diagram_layer, {are_containers_preserved}, {grouping_distance_absolute}, {vertices_removal_rule}, {run_async})
NameExplanationData Type
in_network_diagram_layer

The network diagram to which the layout will be applied.

Diagram Layer
are_containers_preserved
(Optional)

Specifies how containers will be processed by the Compression layout algorithm.

  • PRESERVE_CONTAINERS The Compression layout algorithm will execute on the top graph of the diagram so containers are preserved. This is the default.
  • IGNORE_CONTAINERSThe Compression layout algorithm will execute on both content and noncontent features in the diagram.
Boolean
grouping_distance_absolute
(Optional)

The grouping distance is used to determine whether two connected junctions are close enough to be considered part of the same junctions group. A junctions group represents many junctions that are moved as a group during execution. The group can contain both junctions and containers. To group two junctions, they must also be connected in the diagram by an edge. The default is 20 units in the diagram's coordinate system.

Linear Unit
vertices_removal_rule
(Optional)

Specifies which vertices along edges in the diagram will be removed.

  • ALLAll vertices on all edges will be removed from the diagram.
  • OUTERAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, a vertex is added at the intersection of the edge and container polygon. This is the default.
  • OUTER_EXCEPT_FIRSTAny edge vertices that are within the detected junctions' groups will be maintained, while edge vertices that are outside will be removed.When there are containers in the diagram that have edges that intersect the container polygons, the first (or last) outside vertex is preserved on edges that intersect a container polygon. A vertex is automatically inserted at the intersection of the edges and container polygons.
String
run_async
(Optional)

Specifies whether the layout algorithm will run asynchronously or synchronously on the server.

  • RUN_ASYNCHRONOUSLYThe layout algorithm will run asynchronously on the server. This option dedicates server resources to run the layout algorithm with a longer time-out. Running asynchronously is recommended when executing layouts that are time consuming and may exceed the server time-out (for example, Partial Overlapping Edges) and applying to large diagrams (more than 25,000 features).
  • RUN_SYNCHRONOUSLYThe layout algorithm will run synchronously on the server. It can fail without completion if its execution exceeds the service default time-out value of 600 seconds. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_network_diagram_layer

The updated network diagram layer.

Diagram Layer

Code sample

ApplyCompressionLayout example (Python window)

Apply the Compression Layout algorithm to the diagram called Temporary Diagram.

import arcpy
arcpy.ApplyCompressionLayout_nd("Temporary Diagram", "PRESERVE_CONTAINERS", 
                                "20 Feet", "OUTER", "RUN_SYNCHRONOUSLY")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics