Import Territories From Database (Territory Design)
Summary
Tool imports entire territories hierarchy from territories database.
Usage
-
Fields for importing territories hierarchy from database and level names must be specified in format: Name Field {ID Field} {Level Name}; ...
- Levels must be defined in the control from bottom to top levels. For instance, Territories, Regions, Areas…
- Name Field – field of database with territory names. Imported territories will have names stored in this field. This is required parameter.
- ID Field – field of database with territory IDs. Imported territories will have IDs stored in this field. This is optional parameter – "#" can be specified instead for use territory names as IDs.
- Level Name – name of specified level. This is optional parameter – "#" can be specified instead for used default level names read from ATDConfig.xml
One of String, Integer, SmallInteger, Double, Single, Date, OID, GlobalID, GUID, XML field of Alignment Layer can be used as Alignment Layer’s Join Field
One of String, Integer, SmallInteger, Double, Single, Date, OID, GlobalID, GUID, XML field of Alignment Layer can be used as database’s Join Field
Syntax
Parameter | Explanation | Data Type |
in_territory_solution_layer |
Territory Solution layer to import territories to | GP TD Layer |
in_database |
Table with territories hierarchy data | Table |
in_fields_map [in_fields_map,...] |
Fields for importing territories hierarchy from database and level names | Fields Map |
in_al_join_field (Optional) |
Field in Alignment Layer to join with imported table | Field |
in_table_join_field (Optional) |
Field in importing table to join with Alignment Layer | Field |
Code Sample
The following Python window script demonstrates how to use the tool in immediate mode.
import arcgisscripting
gp = arcgisscripting.create()
gp.ImportTerritoriesFromDatabase_TD("new layer", "C:/Data/TerritoryHierarchy.dbf", "Territorie Territo_ID Territories;Regions Regions_ID Regions", "ID", "ID")
The following stand-alone script demonstrates how to use the tool.
# Import system modules
import arcgisscripting
gp = arcgisscripting.create()
# Set local variables
solution = "new layer"
database = "C:/Data/TerritoryHierarchy.dbf"
fieldsMap = "Territorie Territo_ID Territories;Regions Regions_ID Regions"
alJoinField = "ID"
dbJoinField = "ID"
# Execute tool
gp.ImportTerritoriesFromDatabase_TD(solution, database, fieldsMap, alJoinField, dbJoinField)