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...

Balance Territories

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

Summary

Balances existing territories.

Usage

  • The Territory Level format must be as follows: Level_Name[Level_Index].

    The Balancing variables should be specified, via UI or the Setup Level Balancing Variables tool.

    The Distance constraints (see Maximum Distance, Minimum Distance and Minimum Distance Between Centers parameters) or Capacity constraints can be specified via UI or the appropriate GP tool.

Syntax

BalanceTerritories_td (in_territory_solution_layer, in_level, in_balancing_method, {in_autofill_extent}, {in_keep_invalid_territories})
ParameterExplanationData Type
in_territory_solution_layer

The Territory Solution layer to be balanced.

GP TD Layer
in_level

The Territory Level to modify.

String
in_balancing_method

This parameter ensures that all available features will be used while modifying territories.

  • EXTEND_COVERAGE_AREA — all available features will be used during balancing
  • WORK_CURRENT_COVERAGE_AREA — only features assigned to territories at the start will be used during balancing
Boolean
in_autofill_extent
(Optional)

This parameter ensures that all unassigned features will be added to their closest territories regardless of the constraint parameters. This option may affect the assigned parameters in order to include all territories in the solution.

  • AUTO_FILL_EXTENT — adds all unassigned features to their closest territories
  • DO_NOT_AUTO_FILL_EXTENT — unassigned features will not change their state
Boolean
in_keep_invalid_territories
(Optional)

This parameter ensures that all modified territories, exceeding constraints, will not be automatically emptied. This is useful for finding the reasons why there are a number of empty territories (for example, if constraints are opposite each other).

  • OVERRIDE_CONSTRAINTS — does not automatically un-assign all features from territories that violate specified constraints
  • DO_NOT_OVERRIDE_CONSTRAINTS — automatically un-assigns all features from territories that violate specified constraints (a warning message will appear)
Boolean

Code Sample

The following Python window script demonstrates how to use the Business Analyst geoprocessing tool in immediate mode.

import arcgisscripting
gp = arcgisscripting.create()
gp.BalanceTerritories_TD("new layer", "Territories[1]", "EXTEND_COVERAGE_AREA", "DO_NOT_AUTO_FILL_EXTENT", "DO_NOT_OVERRIDE_CONSTRAINTS")

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"
level = "Territories[1]"
balanceMethod = "EXTEND_COVERAGE_AREA"
autoFillExtent = "DO_NOT_AUTO_FILL_EXTENT"
overrideConstraints = "DO_NOT_OVERRIDE_CONSTRAINTS"

# Execute tool
gp.BalanceTerritories_TD(solution, level, balanceMethod, autoFillExtent, overrideConstraints)

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

  • Add Territory Level
  • An Overview of the Improve Territories Toolset
  • Create Territories
  • Import Territories From Database
  • Remove Solution Extent
  • Setup Level Balancing Variables
  • Setup Level Capacity Constraints
  • Setup Level Distance Constraints
  • Setup Level Territory Shape Parameters
  • Setup Solution Barriers
  • Setup Solution Extent By Boundary of Layer
  • Setup Solution Extent By Current Map View
  • Setup Solution Extent By Current Selection
  • Setup Solution Restricted Areas
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