Skip To Content

Common topology tasks

Available with Standard or Advanced license.

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 new dirty areas and error features and necessitate that the topology be revalidated. The schema edits listed in this topic can be made to topologies within an enterprise geodatabase, regardless of whether or not they are versioned.

You can manage a lot of common topology tasks using the Topology Properties dialog. From Topology Properties you can change 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 new feature class to a topology

Use geoprocessing

Here are the steps to add a new 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. The first parameter to enter is the path to the location of the topology that you want to add feature classes to, 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 XY 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–7 to add multiple feature classes to a 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, you should be aware of the options 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 within a feature class. For example, in a parcel feature class, you might have subclasses of normal parcels (which cannot overlap) and condo parcels (which are allowed to overlap). Further, the default value for zoning might be different for each parcel subtype (for example, Single Family residential versus Multifamily residential).

To learn more about subtypes and the geodatabase, see An overview of subtypes.

Subtypes within a topology

Subtypes in topologies can have different rules applied to each subtype as well as different coordinate ranks. This allows you to create rules that apply only to specific subtypes, for example, structures built before the subdivision was created.

For example, consider building footprints—you could model a situation where a small percentage of buildings legitimately cross parcel boundaries by creating subtypes of buildings and only creating the Must Be Covered By rule for the subtypes that cannot extend across a parcel.

Subtypes allow you finer control in setting up topology rules

You could also apply different coordinate ranks to each subtype. For example, parcels whose boundaries were entered using COGO tools might have a higher coordinate rank than other parcels in a different subtype that were entered using digitizing.

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. The first parameter to enter is 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 now removed from the topology. To remove multiple feature classes, run this tool for each feature class you want to remove.

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

In the Catalog pane, do the following:

  1. 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 the topology need not be revalidated.

Tip:

You cannot rename feature classes while they are 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. The first parameter to enter is 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. For the second parameter, type a new cluster tolerance value, for example, 0.00015.
  5. Press Enter to run the command.
Note:

Changing the cluster tolerance of a topology will require that the topology 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 by 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. The first parameter to enter is the path to the location of the topology that you want to add the rule to, 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 on 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 now added to the topology. For multiple rules, you will need to run this tool multiple times.

Note:

After adding a new rule, you must revalidate your 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. The first parameter to enter is 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, you will need to run this tool multiple times.

Note:

Removing a rule will require the topology to be revalidated.

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

There are a number of ways to change rank settings in a topology.

Change the number of ranks

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

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

Note:

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

Change the rank of a feature class

  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. Click OK.
  4. Type the rank for each feature class.
  5. Click OK.
Note:

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

Work with topology rules

There are many tasks to work with rules within a topology. You can do the following:

  • Save rules as a rule set file that can be shared and reused.
  • View rule descriptions and diagrams.

Save topology rules to a Rule Set File

  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

  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 will 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 will append the rules from the Rule Set to the existing rules.

Note:

Loading a Rule Set will require the topology to be revalidated.

Note:

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 will not be loaded.

Summarize topology errors

You can view a summary of the number of errors in a topology from the Topology Properties dialog box. The summary tells you how many errors and exceptions exist for each of the topology rules.

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 programmers with 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 for .NET.