ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Import Territories From Database

获得 Business Analyst 许可后可用。

  • 描述
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

Imports an entire territory hierarchy from a territories database.

使用方法

  • 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

语法

arcpy.td.ImportTerritoriesFromDatabase_TD(in_territory_solution_layer, in_database, in_fields_map, {in_al_join_field}, {in_table_join_field})
参数说明数据类型
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
(可选)

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

Field
in_table_join_field
(可选)

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

Field

代码示例

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 = "Territory Territory_ID Territories;Regions Regions_ID Regions"
alJoinField = "ID"
dbJoinField = "ID"

# Execute tool
gp.ImportTerritoriesFromDatabase_TD(solution, database, fieldsMap, alJoinField, dbJoinField)

环境

此工具不使用任何地理处理环境。

许可信息

  • Basic: 需要 Business Analyst
  • Standard: 需要 Business Analyst
  • Advanced: 需要 Business Analyst

相关主题

  • An Overview of the Create Territories Toolset
  • Create Territories

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明