获得 Business Analyst 许可后可用。
描述
Generates trade areas based on standard geographic units from ArcGIS Online. Note that you must be signed into ArcGIS to use this tool.
使用方法
The spatial reference of the output feature class will be the same as the input geography boundary layer.
Use the Append Table Attributes to Output Feature Class option to include the demographic data of an Esri dataset in the output trade areas.
The Table Containing Matching Geography IDs must be in a format compatible with ArcMap. Your tabular data can be in the form of a database file format (.dbf) file, a comma- or tab-delimited text (.txt) file, or a relational database management system (RDBMS).
All nonmatching ZIP Codes will be excluded in the output trade area.
Nonmatching ZIP Codes are ZIP Code records in the Table Containing Matching Geography IDs that are not valid and do not have a corresponding feature in the input geography boundary layer.
If you want to select from a list of available geographic features to create a study area, you can use the Trade Area wizard in ArcMap. Selecting geographic features is not available as a geoprocessing tool.
In ArcMap, trade areas will only be created for features that are within the active study area or analysis extent.
语法
arcpy.ba.GPCreateTAFromOnlineStandardGeographyLevels(OnlineStdLayerID, InputGeographyUnitsTable, InputGeographyUnitsIdField, InputHandleDuplicateBehavior, OutputFeatureClass, {InputAppendVisibleFields}, {InputGeographyUnitsStoreIdField}, {Dissolve})
参数 | 说明 | 数据类型 |
OnlineStdLayerID | The input level used to build the trade area. | Feature Layer |
InputGeographyUnitsTable | The input table used to select the standard geography units that will define the trade area. | Table View |
InputGeographyUnitsIdField | The associated geography ID field used to select the geographic units from the input geography boundary layer. | Field |
InputHandleDuplicateBehavior | Allows you to filter duplicate fields in the table containing matching geographic IDs.
| String |
OutputFeatureClass | The feature class that will contain the trade area features. | Feature Class |
InputAppendVisibleFields (可选) | Appends the fields from the geography boundary to the output feature class.
| Boolean |
InputGeographyUnitsStoreIdField (可选) | This field assigns the same standard geography units to several stores. | Field |
Dissolve (可选) | This option dissolves the output based on the selected Store ID.
| Boolean |
代码示例
CreateTAFromOnlineGeographyLevels example (stand-alone script)
# Name: CreateTAFromOnlineGeographyLevels.py
# Description: The following stand-alone script demonstrates how to use the CreateTAFromOnlineGeographyLevels tool.
# Author: Esri
# Import system modules
import arcview
import arcpy
arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.8\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
# Acquire extension license
arcpy.CheckOutExtension("Business")
# Define input and output parameters for the Create Trade Area From Online Geography Levels tool.
# Please note that your paths may be different.
InputOnlineLayer = "US.Zip5"
InputGeographyUnitsTable = "C:/ArcGIS/Business Analyst/US_2022/Datasets/Tutorial/sf_custs.dbf"
InputGeographyUnitsIdField= "ZIP"
InputHandleDuplicateBehavior = "USE_FIRST_FEATURE"
OutputFeatureClass = "C:/temp/CreateTAO.shp"
InputAppendVisibleFields = "TRUE"
InputGeographyUnitsStoreIdField = "STORE_ID"
Dissolve = "FALSE"
# Create standard online geography based trade area
arcpy.CreateTAFromOnlineGeographyLevels_ba(InputOnlineLayer,
InputGeographyLevelIdField,
InputGeographyUnitsTable,
InputGeographyUnitsIdField,
InputHandleDuplicateBehavior,
OutputFeatureClass,
InputAppendVisibleFields,
InputGeographyUnitsStoreIdField,
Dissolve)
# Release extension license
arcpy.CheckInExtension("Business")
环境
此工具不使用任何地理处理环境。
许可信息
- Basic: 需要 Business Analyst
- Standard: 需要 Business Analyst
- Advanced: 需要 Business Analyst