获得 Business Analyst 许可后可用。
描述
Creates a segmentation profile with an existing customer layer.
Learn more about how Create Profile By Customer Layer (Business Analyst) works
使用方法
The Customer Layer must be a point feature class.
In most cases, the Customer Layer will be a Business Analyst customer layer.
If your customer layer already has a segmentation code appended, the profile will be created significantly faster using the Create Profile From Segmentation Coded Table tool.
This tool uses a point-in-polygon approach to append a segmentation code to each customer. This tends to be much slower than appending the segmentation code when you are address geocoding your customer file. This tool should only be used with existing customer layers that do not have a segmentation code appended.
Choosing the lowest level of geography for the segmentation layer will provide the highest degree of accuracy. For example, in the United States, use block groups to create a profile of existing customer records.
语法
arcpy.ba.CreateSegProfileByLayer(Dataset, SegmentationBase, SegmentationLayer, ProfileFolder, {InputVolumeInfoFieldName}, {InputProfileComments})
参数 | 说明 | 数据类型 |
Dataset | The input feature class containing the points needed to generate the profile. In most cases, this will be a Business Analyst customer layer. | Feature Layer |
SegmentationBase | Population or household base for the profile being created. | String |
SegmentationLayer | Layer used to assign the segmentation code for each customer. A point-in-polygon procedure is used with this layer to determine how to assign a segmentation code to each customer. | Feature Layer |
ProfileFolder | The folder where the output profile will be created. The folder name corresponds to the name of the profile used in Business Analyst. For example, a profile created in the folder C:\My Output Data\Projects\Default Project\Segmentation\Profiles\NewProfile would be referred to as NewProfile in Business Analyst. | Folder |
InputVolumeInfoFieldName (可选) | Field containing volume information with which the profile can optionally be created. For example, you can create a profile using the sales for each customer. | Field |
InputProfileComments (可选) | Optional comments for profile. These comments can include information such as author, source, date, and vintage. | String |
代码示例
CreateSegProfileByLayer example (stand-alone script)
# Name: CreateSegProfileByLayer.py
# Description: Creates a customer based segmentation profile using sample customers from the San Fransisco area.
# 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")
try:
# Acquire extension license
arcpy.CheckOutExtension("Business")
# Define input and output parameters for the Create Profile by Customer Layer tool
Dataset = "C:/temp/sf_cust.shp"
SegmentationBase = "Total Adult Population"
SegmentationLayer = "US.BDS.BlockGroups"
ProfileFolder = "C:/temp/NewProfile1/profile.xml"
# Create Profile by Customer Layer
arcpy.CreateSegProfileByLayer_ba(Dataset, SegmentationBase, SegmentationLayer, ProfileFolder)
# Release extension license
arcpy.CheckInExtension("Business")
环境
此工具不使用任何地理处理环境。
许可信息
- Basic: 需要 Business Analyst
- Standard: 需要 Business Analyst
- Advanced: 需要 Business Analyst