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

许可等级:BasicStandardAdvanced

摘要

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

用法

语法

CreateTAFromSubgeography_ba (InputBoundaryLayer, InputBoundaryLayerIdFieldName, All_Or_Single_Or_Selected, InputSubgeographyLayer, InputSubgeographyLayerIdFieldName, InputSubgeographyLayerNameFieldName, OutputFeatureClass, InputSubgeographyCalcRatiosOption, InputSubgeographySpatialRshipOption, {ByID_Or_ByName}, {Single_Site})
参数说明数据类型
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
(可选)

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
(可选)

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

String

代码实例

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)

环境

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

相关主题

许可信息

ArcGIS for Desktop Basic: 需要 Business Analyst
ArcGIS for Desktop Standard: 需要 Business Analyst
ArcGIS for Desktop Advanced: 需要 Business Analyst
4/27/2014