Summary
Creates a geometric network in a geodatabase using the specified feature classes, role for each feature class, and the specified weights with weight associations.
Usage
The feature classes must reside in the same feature dataset as the geometric network.
Only point and line feature classes are supported as input. The feature classes cannot participate in another geometric network or other advanced geodatabase dataset such as a topology, network dataset, terrain, or fabric.
Connectivity in geometric network is based on the geometric coincidence of features. Ideally, your data should be clean before you build a network. However, if this is not the case, the data may be snapped during the network building process. While the snapping available within the geometric network wizard can help ensure coincidence, it should not be the only solution used. There are other options available for ensuring clean data, such as Topology, which can help clean up your data in preparation for use in a geometric network. The snapping performed during geometric network creation cannot be undone. If the geometric network is deleted, snapped features do not revert to their original locations.
When building a geometric network from existing feature classes, certain geometries that are illegal within the geometric network, or conditions that you should be aware of, may be encountered in some of the input feature classes. When this is encountered, a warning message is displayed at the end of the network building process and a table with the name <geometricnetwork_name>_BUILDERR is created in the database containing a record of these errors.
Syntax
CreateGeometricNetwork_management (in_feature_dataset, out_name, in_source_feature_classes, {snap_tolerance}, {weights}, {weight_associations}, {z_snap_tolerance}, {preserve_enabled_values})
Parameter | Explanation | Data Type |
in_feature_dataset | The feature dataset in which the geometric network will be created. In an enterprise geodatabase, the feature dataset and feature classes that will participate in the geometric network cannot be versioned. | Feature Dataset |
out_name | The name of the geometric network to be created. | String |
in_source_feature_classes [[feature_class_name, role, source_or_sink],...] | The input feature classes to be added to the geometric network and the role the feature class should play in the geometric network. Roles can be:
For each simple junction feature class, whether it will participate in flow direction with Sources and Sinks.
| Value Table |
snap_tolerance (Optional) | The snapping tolerance to be set on the geometric network. The larger the value, the more likely vertices will be to snap together. The default value is empty, which means that no snapping will be performed during geometric network creation. The snapping performed during geometric network creation cannot be undone. | Double |
weights [[weight_name, type, bitgate_size],...] (Optional) | Weights are the cost of traveling along an edge in a network. For example, in a water network, a weight can be the length of the pipe. Indicate the weight name, weight type, and for bitgate weights, the size. The type of the weight determines which feature class fields can be associated with the weight. Types can be one of the following:
| Value Table |
weight_associations [[feature_class_name, field, weight_name],...] (Optional) | Specifies the weight associations for each field and feature class. When adding a new network weight, it must be associated with a field in a feature class which will provide the values to determine the weight for the features. | Value Table |
z_snap_tolerance (Optional) | The snapping tolerance to be set on the geometric network with z-coordinate based snapping. The larger the value, the more likely vertices will be to snap together. The default value is empty which means that no snapping will be performed during geometric network creation, and the geometric network will not support Zs. A value of zero indicates that no snapping will be performed during the geometric network creation, but the geometric network will support Zs. | Double |
preserve_enabled_values (Optional) | Specifies whether to preserve the values in any existing enabled fields or whether the values should be reset to their default value of True.
| Boolean |
Code sample
CreateGeometricNetwork example (stand-alone script)
The following Python window script demonstrates how to use the CreateGeometricNetwork function in immediate mode to create a geometric with six feature classes, one weight associated with two of those classes and a snapping tolerance.
# Import arcpy module
import arcpy
# Local variables:
Water = "C:/arcgis/ArcTutor/BuildingaGeodatabase/Montgomery.gdb/Water"
# Process: Create Geometric Network
arcpy.CreateGeometricNetwork_management(Water, "Water_Net", "Distribmains COMPLEX_EDGE NO;Fittings SIMPLE_JUNCTION NO;Hydrants SIMPLE_JUNCTION NO;Sysvalves SIMPLE_JUNCTION NO;Tanks SIMPLE_JUNCTION YES;Transmains COMPLEX_EDGE NO", "0.5", "Friction_Factor DOUBLE #", "Distribmains FRICTION_FACTOR Friction_Factor;Transmains FRICTION_FACTOR Friction_Factor", "", "PRESERVE_ENABLED")
Environments
This tool does not use any geoprocessing environments
Licensing information
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes