Import Trace Configurations (Trace Network)

Summary

Imports named trace configurations from JSON format (.json file) to a trace network.

This tool can be used in conjunction with the Export Trace Configurations tool.

Learn more about importing trace configurations

Usage

  • The input trace network must be version 2 or later.

  • The following requirements must be met when working with an enterprise geodatabase:
    • The Input Trace Network parameter value must be from a trace network service.

    Note:
  • The named trace configurations must be in a single .json file.

  • The information in the .json file is stored in the following format:

    [
    	{
    		"creator": "<property representing the connected portal account on creation>",
    		"name": "<property  representing the name of the named trace configuration>",
    		"description": "<property representing the description of the named trace configuration>",
    		"traceType": <property representing the trace type>,
    		"configuration": <property representing the collection of trace configuration parameters>,
    		"resultTypes": "[<property representing the types of results to return>]",
    		"tags": "<property representing user provided tags>"
    	}
    ]

    Example JSON to import named trace configurations into a trace network using the Import Trace Configurations tool:

    [
    	{
    		"creator": "TN_Admin",
    		"name": "Connected trace HUC12",
    		"description": "Connected trace for HUC12",
    		"traceType": 1,
    		"configuration": 
            {"{"includeBarriers":true,"validateConsistency":true,"ignoreBarriersAtStartingPoints":true,"allowIndeterminateFlow":true,
             "traversabilityScope":"junctionsAndEdges","combineUsingOr":false,"isSpecificValue":true}],"functionBarriers":[],
             "functions":[],"outputFilters":[],"outputConditions":[],}",},
    		"resultTypes": "[{"type":"elements","includeGeometry":false,"includePropagatedValues":false,"networkAttributeNames":[],"diagramTemplateName":"","resultTypeFields":[]},{"type":"aggregatedGeometry","includeGeometry":false,"includePropagatedValues":false,"networkAttributeNames":[],"diagramTemplateName":"","resultTypeFields":[]}]",
      "tags": "connected,nhd,huc12"
    	}
    ]

Parameters

LabelExplanationData Type
Input Trace Network

The target trace network to which the named trace configurations will be imported.

Trace Network; Trace Network Layer
Input File (.json)

The .json file containing the named trace configurations to import.

File

Derived Output

LabelExplanationData Type
Updated Trace Network

The updated trace network.

Trace Network

arcpy.tn.ImportTraceConfigurations(in_trace_network, in_json_file)
NameExplanationData Type
in_trace_network

The target trace network to which the named trace configurations will be imported.

Trace Network; Trace Network Layer
in_json_file

The .json file containing the named trace configurations to import.

File

Derived Output

NameExplanationData Type
out_trace_network

The updated trace network.

Trace Network

Code sample

ImportTraceConfigurations example (Python window)

This sample script imports named trace configurations into a trace network called HydroTraceNetwork.

import arcpy
arcpy.ImportTraceConfigurations_tn("HydroTraceNetwork", 
                                   r"c:\temp\trace_configurations.json")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics