Create Trade Area From Sub-geography Layer (Business Analyst)

License Level:BasicStandardAdvanced

Summary

Generates trade areas from the features of an input polygon layer that intersects a defined boundary layer.

Learn more about how Create Trade Area From Subgeography Layer works

Usage

Syntax

CreateTAFromSubgeography_ba (InputBoundaryLayer, InputBoundaryLayerIdFieldName, All_Or_Single_Or_Selected, InputSubgeographyLayer, InputSubgeographyLayerIdFieldName, InputSubgeographyLayerNameFieldName, OutputFeatureClass, InputSubgeographyCalcRatiosOption, InputSubgeographySpatialRshipOption, {ByID_Or_ByName}, {Single_Site})
ParameterExplanationData Type
InputBoundaryLayer

The input geography boundary layer used to define the geographies to extract.

Feature Layer
InputBoundaryLayerIdFieldName

The unique identifier for the boundary layer.

Field
All_Or_Single_Or_Selected

Creates trade areas for features in the boundary layer.

  • AllCreates trade areas for all features.
  • SingleCreates trade areas for a single feature.
  • SelectedCreates trade areas for all selected features in ArcMap.
String
InputSubgeographyLayer

The layer containing the features to be extracted as trade areas. In most cases, this will be a Business Analyst data layer, such as ZIP Codes.

Feature Layer
InputSubgeographyLayerIdFieldName

The unique ID field for the subgeography layer.

Field
InputSubgeographyLayerNameFieldName

The name field for the subgeography layer.

Field
OutputFeatureClass

The feature class that will contain the trade area features.

Feature Class
InputSubgeographyCalcRatiosOption

Generates a percentage based on how much each subgeography intersects the Boundary layer and appends these values to the subgeography layer.

  • All RatiosThe values calculated will contain percentages for Population, Housing Units, Households, and Business Points.
  • Area OnlyThe percentage will only be calculated for areas of the subgeographies that intersect the boundary layer.
  • NoneNo percentages will be calculated.
String
InputSubgeographySpatialRshipOption

Determines how the subgeography will be selected from the boundary layer.

  • IntersectIf any of the subgeography features touch or intersect the boundary layer, they will be included in output layer.
  • Centroid WithinIf the centroids of any of the subgeography features are contained within the boundary layer, they will be included in the output layer.
  • Completely WithinOnly the features of the subgeography layer that are completely contained within the boundary layer will be included in the output layer.
String
ByID_Or_ByName
(Optional)

Field used to select a single feature.

  • IDSelects a single feature using the ID field.
  • NameSelects a single feature using the name field.
String
Single_Site
(Optional)

ID or name of the feature used to select a single feature.

String

Code Sample

CreateTAFromSubgeography Example (Stand-alone Script)
# Name: CreateTAFromSubgeography.py
# Description: Selects all the block groups that intersect the input boundary layer exports them as a new layer.
# Author: Esri

# Import system modules
import arcview
import arcpy

arcpy.ImportToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.2\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
 
try:
# Acquire extension license 
  arcpy.CheckOutExtension("Business") 

  arcpy.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.2\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
 
# Define input and output parameters for the Create Trade Area From Subgeography Layer tool
  Boundary = "C:/temp/TradeArea.shp"
  InputGeo = "C:/ArcGIS/Business Analyst/US_2013/Data/BDS/esri_bg.bds"
  OutPath = "C:/temp/Output_Geography.shp"
  BoundaryId = "AREA_ID"
  SubGeoId = "ID" 
  SubGeoName = "NAME"
 
# Create Subgeography based trade areas
  arcpy.CreateTAFromSubgeography_ba(sBoundary, sBoundaryId, "ALL", sInputGeo, sSubGeoId, sSubGeoName, sOutPath)
 
# Release extension license 
  arcpy.CheckInExtension("Business") 
 
except:
  print arcpy.GetMessages(2)

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Business Analyst
ArcGIS for Desktop Standard: Requires Business Analyst
ArcGIS for Desktop Advanced: Requires Business Analyst
3/3/2014