ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Import Territories From Database

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Imports an entire territory hierarchy from a territories database.

Usage

  • The 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 – database field of territory names. Imported territories will have names stored in this field. This is a required parameter.
    • ID Field – database field of territory IDs. Imported territories will have IDs stored in this field. This is an optional parameter. The pound sign "#", can be specified when using territory names as IDs instead.
    • Level Name – the name of the specified level. This is an optional parameter. The pound sign "#", can be specified when using default level names read from an ATDConfig.xml file instead.

  • A String, Integer, SmallInteger, Double, Single, Date, OID, GlobalID, GUID, XML field of Alignment Layer can be used as the Alignment Layer’s Join Field

  • A String, Integer, SmallInteger, Double, Single, Date, OID, GlobalID, GUID, XML field of Alignment Layer can be used as the database’s Join Field

Syntax

ImportTerritoriesFromDatabase_TD_td (in_territory_solution_layer, in_database, in_fields_map, {in_al_join_field}, {in_table_join_field})
ParameterExplanationData Type
in_territory_solution_layer

The Territory Solution layer to where to import territories.

GP TD Layer
in_database

The Table with the territories hierarchy data.

Table
in_fields_map
[in_fields_map,...]

The Fields for importing territories hierarchy from database and level names.

Fields Map
in_al_join_field
(Optional)

The Field in the Alignment Layer with which to join an imported table.

Field
in_table_join_field
(Optional)

The Field in an imported table with which to join the Alignment Layer.

Field

Code Sample

ImportTerritoriesFromDatabase example (Python window)

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")
ImportTerritoriesFromDatabase example 2 (stand-alone script)

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)

Environments

This tool does not use any geoprocessing environments

Licensing Information

  • ArcGIS for Desktop Basic: Requires Business Analyst
  • ArcGIS for Desktop Standard: Requires Business Analyst
  • ArcGIS for Desktop Advanced: Requires Business Analyst

Related Topics

  • An Overview of the Create Territories Toolset
  • Create Territories
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal