Thiessen Polygons (Business Analyst)
摘要
Generates competitive advantage trade areas for each store by creating boundary lines equidistant from each of the store locations.
插图
用法
-
The spatial reference of the output feature class will be the same as the store layer.
-
The store layer input feature class must be point features.
-
In most cases, the store layer input feature layer will be a Business Analyst store layer.
-
Selecting all sites to use will create rings for each point feature in the ring centers (stores) input feature class.
-
In ArcMap, trade areas will only be created for features that are within the active study area or analysis extent.
-
There must be at least two store points in the input store layer for this tool to work.
语法
参数 | 说明 | 数据类型 |
StoreLayer |
The input feature class containing center points for the Thiessen polygons. In most cases, this will be a Business Analyst store layer. | Feature Layer |
StoreIDField |
Unique ID field in the polygon center (store) layer. | Field |
All_Or_Single_Or_Selected |
Defines how to create polygons for points in the input feature layer.
| String |
OutputFeatureClass |
The feature class that will contain the polygon features. | Feature class |
ByID_Or_ByName (可选) |
Field used to select a single point.
| String |
Single_Site (可选) |
ID or name of store to be used as the single point. | String |
代码实例
# Name: ThiessenPolygons.py
# Description: Creates Thiessen based trade areas around selected stores.
# Author: Esri
# Import system modules
import arcview
import arcpy
arcpy.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.2\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
try:
# Acquire extension license
arcpy.CheckOutExtension("Business")
# Define input and output parameters for the Thiessen Polygons tool
StorePath = "C:/temp/sf_stores.shp"
IdFld = "STORE_ID"
OutPath = "C:/temp/ThiessenPolygons.shp"
# Create Thiessen Polygon based trade areas
arcpy.ThiessenPolygons_ba(StorePath, IdFld, "ALL", OutPath)
# Release extension license
arcpy.CheckInExtension("Business")
except:
print arcpy.GetMessages(2)