Available with Standard or Advanced license.
Summary
Adds a feature class to a topology.
Usage
The new feature class must be in the same feature dataset as the topology.
Adding a new feature class to a topology automatically makes the entire topology dirty, so when you finish adding feature classes, you will need to revalidate the topology. The new features may create errors where previously there were none depending on the topology rules associated with the feature class.
Feature classes can only be added to topologies with the same versioned status. For example, a versioned feature class can be added to a versioned topology, but a non-versioned feature class cannot be added to a versioned topology.
If the feature class you are adding is z-aware, you can rank the relative accuracy of the feature class by elevation by setting the z rank for the feature class.
When adding a feature class to a topology, you must specify the rank of the vertices in this feature class relative to those in other feature classes. When validation of the topology cracks and clusters feature vertices, vertices from feature classes assigned a higher rank will not be moved when snapping with vertices with lower-ranked feature classes. The highest rank is 1, and you can assign up to 50 different rank values.
Syntax
arcpy.management.AddFeatureClassToTopology(in_topology, in_featureclass, xy_rank, z_rank)
Parameter | Explanation | Data Type |
in_topology | The topology to which the feature class will participate. | Topology Layer |
in_featureclass | The feature class to add to the topology. The feature class must be in the same feature dataset as the topology. | Feature Layer |
xy_rank | The relative degree of positional accuracy associated with vertices of features in the feature class versus those in other feature classes participating in the topology. The feature class with the highest accuracy should get a higher rank (lower number, for example, 1) than a feature class which is known to be less accurate. | Long |
z_rank | Feature classes that are z-aware have elevation values embedded in their geometry for each vertex. By setting a z rank, you can influence how vertices with accurate z-values are snapped or clustered with vertices that contain less accurate z measurements. | Long |
Derived Output
Name | Explanation | Data Type |
out_topology | The updated topology. | Topology Layer |
Code sample
The following stand-alone script demonstrates how to use the AddFeatureClassToTopology function.
# Name: AddFeatureClassToTopology_Example.py
# Description: Adds a feature class to participate in a topology
# Import system modules
import arcpy
arcpy.AddFeatureClassToTopology_management("D:/Calgary/Trans.gdb/Streets/Street_Topo", "D:/Calgary/Trans.gdb/Streets/StreetNetwork", 1, 0.1)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes