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 run.

  • This layout 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 apply to the top graph of the diagram so containers are preserved. This is the default.
  • Unchecked—The Compression layout algorithm will apply to both content and noncontent features in the diagram.

Boolean
Maximum Distance for Grouping
(Optional)

The maximum distance that will be 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 the layout algorithm process. 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 the edge vertices that will be removed from the diagram.

  • All verticesAll edge vertices will be removed from the diagram.
  • All outer verticesAny edge vertices that are within the detected junctions' groups will be maintained; edge vertices that are outside the detected junctions' groups will be removed.When containers in the diagram have edges that intersect the container polygons, a vertex will be 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; edge vertices that are outside the detected junctions' groups will be removed.When containers in the diagram have edges that intersect the container polygons, the first (or last) outside vertex will be preserved on edges that intersect a container polygon. A vertex will be 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 for 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 it 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 apply to the top graph of the diagram so containers are preserved. This is the default.
  • IGNORE_CONTAINERSThe Compression layout algorithm will apply to both content and noncontent features in the diagram.
Boolean
grouping_distance_absolute
(Optional)

The maximum distance that will be 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 the layout algorithm process. 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 the edge vertices that will be removed from the diagram.

  • ALLAll edge vertices will be removed from the diagram.
  • OUTERAny edge vertices that are within the detected junctions' groups will be maintained; edge vertices that are outside the detected junctions' groups will be removed.When containers in the diagram have edges that intersect the container polygons, a vertex will be 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; edge vertices that are outside the detected junctions' groups will be removed.When containers in the diagram have edges that intersect the container polygons, the first (or last) outside vertex will be preserved on edges that intersect a container polygon. A vertex will be 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 for 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 it 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.nd.ApplyCompressionLayout("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