Label | Explanation | Data Type |
Input Trace Network
| The trace network containing the named trace configuration or configurations to export. | Trace Network; Trace Network Layer |
Trace Configuration | The named trace configuration or configurations to export. | String |
Output File (.json) | The output .json file. | File |
Summary
Exports named trace configurations from a trace network to JSON format (.json file).
This tool can be used in conjunction with the Import Trace Configurations tool.
Usage
The input trace network must be version 2 or later.
- When working with an enterprise geodatabase, the following apply:
The Input Trace Network parameter value must be from a trace network service.
Note:
The Input Trace Network parameter value can be from a database connection established as the database trace network owner when connected as the portal trace network owner or a portal account with the administrator role.
The portal trace network owner can view and export any named trace configuration in the trace network. Other users can only view and export the named trace configurations they create.
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 from a trace network using the Export 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
arcpy.tn.ExportTraceConfigurations(in_trace_network, trace_config_name, out_json_file)
Name | Explanation | Data Type |
in_trace_network | The trace network containing the named trace configuration or configurations to export. | Trace Network; Trace Network Layer |
trace_config_name [trace_config_name,...] | The named trace configuration or configurations to export. | String |
out_json_file | The output .json file. | File |
Code sample
This sample script exports a single named trace configuration from a trace network called HydroNetwork.
import arcpy
arcpy.ExportTraceConfigurations_tn("HydroNetwork",
"{399F4M43-ASRV-45D5-5P4C-3GD474E672T4}",
r"C:\temp\exportedtraceconfigurations.json")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes