Perform common topology tasks

Available with Standard or Advanced license.

Once you create a topology, you can modify it as you work with and manage it and its associated layers.

When a topology is published as a web feature layer, the topology is consumed, edited, and validated through a services-oriented architecture using a feature service. In this scenario, the properties of the topology web feature layer are read-only and available modification tasks are limited.

The following table summarizes supported topology modification tasks:

Topology modification taskTopology accessed through ArcGIS ProTopology web feature layer accessed through a feature service

Validate dirty areas in a topology

YesYes

Fix errors and mark exceptions

YesYes

Export topology errors and exceptions

YesYes

Add fields to or delete fields from a feature class participating in a topology

Yes

Alter the alias name of a feature class or fields that participate in a topology

Yes

Topology Properties > Rename a topology

Yes

Topology Properties > Add or remove a feature class to a topology

Yes

Topology Properties > Add, modify or remove topology rules

Yes

Topology Properties > Alter a topology's cluster tolerance

Yes

Topology Properties > Alter the coordinate (XY) rank for a feature class in a topology

Yes

Caution:
The workflows outlined below are supported with a topology accessed, edited, and validated through ArcGIS Pro.

A number of modifications can be made to a topology. In some cases, such as when renaming a topology, the change has no effect on the state of the topology. However, in other cases, the change may require that the topology be revalidated. For example, changes such as adding new feature classes or rules or changing the cluster tolerance may create dirty areas and error features and necessitate that the topology be revalidated.

The schema edits listed in this topic can be made to topologies in an enterprise geodatabase, regardless of whether they are versioned or published as a web feature layer (feature service). When a topology is published and consumed as a feature service and a schema edit needs to be made, stop and restart the service to see the changes.

You can manage many common topology tasks using the Topology Properties dialog box, such as the following:

  • Rename the topology.
  • Change cluster tolerance.
  • Change coordinate ranks.
  • Add and remove feature classes.
  • Create, modify, and delete rules.
  • Save and load rules.

Learn more about topology properties

Add a feature class to a topology

Complete the following steps to add a feature class to an existing topology using the Add Feature Class to Topology tool:

  1. On the Analysis ribbon, click the Python button to open the Python window.
  2. Type the following to run the Add Feature Class to Topology tool: arcpy.AddFeatureClassToTopology_management()
  3. Provide the path to the location of the topology where you want to add the feature classes, for example, "C:\\MyProject\\MyProject.gdb\\Streets\\StreetsTopo".
  4. For the Input Feature Class parameter, type the location of the feature class that you want to add to the topology.

    Only feature classes that are within the feature dataset and are not currently participating in a topology or geometric network can be added.

  5. Type the x,y-coordinate rank for the feature class, or type "" to use the default value.
  6. Type the z-coordinate rank for the feature class, or type "" to use the default value.
  7. Press Enter to run the command.
  8. Repeat steps 2 through 7 to add multiple feature classes to the topology.
  9. Validate the topology using the Validate Topology tool.

The following is an example of the AddFeatureClassToTopology tool executed in the Python window:

arcpy.AddFeatureClassToTopology_management(r"C:\MyProject\MyProject.gdb\Streets\Street_Topo", r"C:\MyProject\MyProject.gdb\Streets\StreetNetwork", 1, 0.1)

Use subtypes in a topology

When you design a geodatabase, consider the options below for using feature class subtypes in your topology.

About subtypes

Subtypes allow you to model real-world objects more effectively by building subclasses of the features in a feature class. For example, the streets in a city streets feature class can be categorized into three subtypes: local streets, collector streets, and arterial streets.

To learn more about subtypes and the geodatabase, see Introduction to subtypes.

Subtypes in a topology

You can create different rules for various subtypes in a topology. This allows you to apply certain rules to specific subtypes.

For example, suppose you have two subtypes of street line features—normal streets (those that connect to other streets at both nodes) and cul-de-sac streets (those that dead end at one node). You can create a topology rule requiring street features to be connected to other street features at both ends, except in the case of streets belonging to the cul-de-sac subtype.

Remove a feature class

You can use the Remove Feature Class From Topology geoprocessing tool to remove a feature class from a topology.

  1. On the Analysis ribbon, click the Python button to open the Python window.
  2. Type the following to run the Remove Feature Class From Topology tool: arcpy.RemoveFeatureClassFromTopology_management()
  3. Provide the path to the location of the topology containing the feature class you want to remove, for example, "C:\\MyProject\\MyProject.gdb\\Streets\\StreetsTopo".
  4. For the Feature Class to Remove parameter, type the location of the feature class that you want to remove from the topology.
  5. Press Enter to run the command.

    The feature class is removed from the topology. To remove multiple feature classes, run this tool for each feature class.

The following is an example of the RemoveFeatureClassFromTopology tool executed in the Python window:

arcpy.RemoveFeatureClassFromTopology_management(r"C:\MyProject\MyProject.gdb\Streets\Street_Topo", r"C:\MyProject\MyProject.gdb\Streets\StreetNetwork")

Rename a topology

To rename a topology, do the following:

  1. In the Catalog pane, right-click the topology and click Rename.
  2. Type a new name.
  3. Press Enter.
Note:

Renaming a topology does not affect its state, and it does not need to be revalidated.

Tip:

You cannot rename a feature class while it is participating in a geodatabase topology.

Change the cluster tolerance

You can use the Set Cluster Tolerance geoprocessing tool to change the cluster tolerance for a topology.

  1. On the Analysis ribbon, click the Python button to open the Python window.
  2. Type the following to run the Set Cluster Tolerance tool: arcpy.SetClusterTolerance_management()
  3. Provide the path to the location of the topology containing the cluster tolerance you want to change, for example, "C:\\MyProject\\MyProject.gdb\\Streets\\StreetsTopo".
  4. Provide a new cluster tolerance value, for example, 0.00015.
  5. Press Enter to run the command.
Note:

When you change the cluster tolerance of a topology, it must be revalidated. The larger the cluster tolerance, the greater the likelihood that features in your data will be moved from their current positions. If the cluster tolerance is too large, the shapes will change.

The following is an example of the SetClusterTolerance tool executed in the Python window:

arcpy.SetClusterTolerance_management(r"C:\MyProject\MyProject.gdb\Streets\Street_Topo", 0.00015)

Work with topology rules

You can add or remove rules from an existing topology using geoprocessing tools.

Add rules to a topology

You can use the Add Rule To Topology geoprocessing tool to add a rule to a topology.

  1. On the Analysis ribbon, click the Python button to open the Python window.
  2. Type the following to run the Add Rule To Topology tool: arcpy.AddRuleToTopology_management()
  3. Provide the path to the location of the topology where you want to add the rule, for example, "C:\\MyProject\\MyProject.gdb\\Streets\\StreetsTopo".
  4. Type the rule you want to add, for example, "Boundary Must Be Covered By Boundary Of (Area-Area)".
  5. Type the path to the origin feature class.
  6. Enter the subtype for the input or origin feature class. Enter the subtype description (not the code). If subtypes do not exist in the origin feature class, or you want the rule to be applied to all subtypes in the feature class, leave this blank "".
  7. Type the path to the destination feature class.
  8. To apply the rule to a subtype in the destination class, enter the subtype description.
  9. Press Enter to execute the command.

    The new rule is added to the topology. For multiple rules, run this tool for each rule.

Note:

After adding a rule, you must revalidate the topology.

The following is an example of the AddRuleToTopology tool executed in the Python window:

arcpy.AddRuleToTopology_management("C:\\MyProject\\MyProject.gdb\\Streets\\Street_Topo",
                                                 "Boundary Must Be Covered By Boundary Of (Area-Area)",
                                                 "C:\\MyProject\\MyProject.gdb\\Streets\\Subdivision",
                                                 "",
                                                 "C:\\MyProject\\MyProject.gdb\\Streets\\Parcels",
                                                 "")

Remove a rule from a topology

You can use the Remove Rule From Topology geoprocessing tool to remove a rule from a topology.

  1. On the Analysis ribbon, click the Python button to open the Python window.
  2. Type the following to run the Remove Rule From Topology tool: arcpy.RemoveRuleFromTopology_management()
  3. Provide the path to the location of the topology containing the rule you want to remove, for example, "C:\\MyProject\\MyProject.gdb\\Streets\\StreetsTopo".
  4. Type the rule you want to remove from the topology, for example, "Must Not Have Dangles (21)".

    When running this tool using scripting, the feature class ObjectClassID involved in the topology rule to be removed must be specified in parentheses after the rule name. Learn more about finding the ObjectClassID.

  5. Press Enter to execute the command.

    The new rule is removed from the topology. To remove multiple rules, run this tool for each rule.

Note:

After removing a rule, you must revalidate the topology.

The following is an example of the RemoveRuleFromTopology tool executed in the Python window:

arcpy.RemoveRuleFromTopology_management("C:\\MyProject\\MyProject.gdb\\Streets\\Street_Topo",
                                                      "Must Not Have Dangles (21)")

Change coordinate ranks

You can change rank settings in a topology.

Change the number of ranks

To change the number of ranks, complete the following steps:

  1. Right-click the topology and click Properties.
  2. Click the Feature Class tab.
  3. Type the number of ranks.
  4. Click OK.

A topology supports up to 50 ranks to which feature classes can be assigned.

Note:

Changing the number of ranks does not require the topology to be revalidated.

Change the rank of a feature class

To change the rank of a feature class, complete the following steps:

  1. Right-click the topology and click Properties.
  2. Click the Feature Class tab.
  3. Click Add Classes and check the boxes next to the feature classes you want to rank.
  4. Click OK.
  5. Type the rank for each feature class.
  6. Click OK.
Note:

Changing the rank of a feature class requires the topology to be revalidated.

Work with topology rules

The subsections below describe how you can work with rules in a topology.

Save topology rules to a rule set file

You can save rules as a rule set file that can be shared and reused.

  1. Right-click the topology and click Properties.
  2. Click the Rules tab.
  3. Click Add .
  4. Choose the feature class you want to apply a rule to from the Feature Class 1 drop-down menu.
  5. If there are subtypes for your feature class, choose the appropriate one from the Subtype drop-down menu.
  6. Choose the rule you want to apply to the feature class from the Rules drop-down menu.
  7. Click OK.

Load topology rules from a rule set file

To load topology rules from a rule set file, complete the following steps:

  1. Right-click the topology and click Properties.
  2. Click the Rules tab.
  3. Click Save Rules.
  4. Click Load Rules.
  5. Browse to where the rule set you want to load is saved.
  6. Click the rule set.
  7. Click Open.

    If the rule set was created from a topology that had the same feature class names as the feature classes in the new topology you're defining, the feature classes named in the rule set should be correctly matched to the feature classes in the new topology. If the names are different, you need to match the feature classes mentioned in the rule set to their corresponding feature classes in the new topology.

  8. For each source feature class that is not mapped, click in the Target column and click the feature class to which it corresponds in the new topology.
  9. Click OK on all dialog boxes.
Note:
  • Loading a rule set into a topology with previously specified rules appends the rules from the rule set to the existing rules.
  • Loading a rule set requires the topology to be revalidated.
  • If there are feature classes specified in a rule set that cannot be matched to feature classes in the new topology, rules involving the unmatched feature classes are not loaded.

Summarize topology errors

You can view a summary of the number of errors in a topology on the Topology Properties dialog box. The summary displays the number of errors and exceptions that exist for each topology rule.

You can save the summary as a text file to create a record of the state of the topology at a given time. This can be a useful way to document and monitor progress on a large topology editing project.

Query and navigate a topology graph

The ArcGIS developer tools provide access to the topology graph, which is a planar representation of the geometries in the feature classes participating in a topology. For more information on working with the topology graph, see the ArcObjects help documentation for .NET.