获得 Business Analyst 许可后可用。
摘要
Generates a report based on the relation of stores to competitors.
Learn more about how Locator Report (Business Analyst) works
用法
The Locator Report is a proximity report that allows you to list the n number of facilities in relation to each of your store locations.
Business points can be competitors, customers, service centers, or any other point layer.
You can extract business data in Business Analyst using the Add Business Listings wizard if you do not have your own competitive locations.
In ArcMap, reports will only be created for features that are within the active study area or analysis extent.
The portrait report allows you to add four fields to the report, and the landscape report allows up to six fields.
Executing this report using drive distance or drive time can take awhile to execute depending on the number of points in the business layer. If you do not use a straight-line distance, a route is created using the street network from each point to each store.
Use the Add Distance Field to Business option to add an attribute field back to the business points layer that will store the distance from the store center point to each feature in the business point layer. You can use this option to store the distance each of your customers is from the nearest store location.
Drive Distance or Drive Time values can show -1 for that business point that doesn't have a route from store. The Locator Report will show NR (No Route) for such a point.
语法
LocatorReport_ba (InputFeatureLayer, IDField, NameFldName, BusinessLayer, IsLandscape, {FieldsToAppear}, {BarrierFeatureClasses}, {ReportFormats}, {All_Or_Single_Or_Selected}, {ByID_Or_ByName}, {Single_Site}, WayToSelectBusiness, {RadiusToSelectBusinesses}, {NumberOfBusinessesToSelect}, {DistanceCalculateMethod}, {AddDistanceToBusiness}, {WayToDefineDistanceField}, {DesireLinesDistanceField}, {NeedReportOutput}, {ReportTitle}, {ReportDir}, {NeedFeatureclassOutput}, {OutputFeatureClass}, {ADD_STORE_FLDS})
参数 | 说明 | 数据类型 |
InputFeatureLayer | The input feature class containing center points for the report. In most cases, this will be a Business Analyst store layer. Distances will be calculated from these points. | Feature Layer |
IDField | Unique ID field in the center points (store) layer. Distances will be calculated from these points. | Field |
NameFldName | Name field in the center points (store) layer. This field will be used in the report to group records for each center point (store). | Field |
BusinessLayer | The input feature class containing points that will be listed in the report. Distances will be calculated from the center points (stores) to all points in this layer. | Feature Layer |
IsLandscape | Locator Report page orientation.
| String |
FieldsToAppear (可选) | Headers and fields to appear in the report. The portrait report allows you to add four fields, and the landscape report allows up to six fields. | String |
BarrierFeatureClasses [BarrierFeatureClasses,...] (可选) | Allows a user to place point, line, or polygon barriers when using drive time or drive distance algorithms to calculate distances. | Feature Layer |
ReportFormats (可选) | Select the desired report output format.
| String |
All_Or_Single_Or_Selected (可选) | Creates trade areas for the points in the input feature layer.
| String |
ByID_Or_ByName (可选) | Field used to select single point.
| String |
Single_Site (可选) | ID or name of store to be used as the single point. | String |
WayToSelectBusiness | Determines how the business locations will be selected in relation to the store layer.
| String |
RadiusToSelectBusinesses (可选) | Determines the radius at which the business points will be selected when choosing the LIMIT_WITHIN_DISTANCE option from the Select Business Points parameter. For example, you could list all business points within a three-mile radius of each store center point. | Linear unit |
NumberOfBusinessesToSelect (可选) | Determines the number of points selected from business points when choosing the LIMIT_TO_NEAREST_LOCATIONS option from the Select Business Points parameter. For example, you could list the 10 closest locations to each store center point. | Long |
DistanceCalculateMethod (可选) | Defines the approach to determine the distance from the store layer to the business points layer.
| String |
AddDistanceToBusiness (可选) | Optionally adds an attribute field back to the business points layer that will store the distance from the store center point to each feature in the business points layer.
| Boolean |
WayToDefineDistanceField (可选) | Determines the method for storing the distance calculation in the business points layer.
| Boolean |
DesireLinesDistanceField (可选) | Name of the distance field. | String |
NeedReportOutput (可选) | Option to generate a report or append the distance calculation to the business points layer.
| Boolean |
ReportTitle (可选) | Title for the locator report. | String |
ReportDir (可选) | The output directory that will contain the report. | Folder |
NeedFeatureclassOutput (可选) | Generates a new feature class of all the business points used in the report.
| Boolean |
OutputFeatureClass (可选) | The output feature class that will contain the business point features used in the report. | Feature Class |
ADD_STORE_FLDS (可选) | Additional store fields that are to be included into the report. | Field |
代码示例
LocatorReport example (stand-alone script)
# Name: LocatorReport.py
# Description: Outputs a proximity report displaying the closest 25 customers to each store.
# Author: Esri
# Import system modules
import arcview
import arcpy
arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.6\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
try:
# Acquire extension license
arcpy.CheckOutExtension("Business")
# Define input and output parameters for the Locator Report tool
Store= "C:/temp/sf_stores.shp"
ID = "STORE_ID"
Name = "NAME"
Cust = "C:/temp/sf_cust.shp"
Flds = "Name:NAME;ZIP:ZIP;City:City_std;State:State_std"
Rpt = "C:/My Output Data/Projects/Default Project/Reports/Locator/Locator.rpt"
Title = "Customer Proximity Report"
NumCust = 25
# Create a Locator Report
arcpy.LocatorReport_ba(Store, ID, Name, Cust, Flds, "PORTRAIT", "All", "#", "#", "LIMIT_TO_NEAREST_LOCATIONS", "5 miles", NumCust, "STRAIGHT_LINE_DISTANCE", "DONT_ADD_DISTANCE", "USE_EXISTING","#", "CREATE_REPORT", Title, Rpt, "DONT_CREATE_OUT_FEATURECLASS")
# Release extension license
arcpy.CheckInExtension("Business")
except:
print arcpy.GetMessages(2)
环境
此工具不使用任何地理处理环境。
许可信息
- ArcGIS Desktop Basic: 需要 Business Analyst
- ArcGIS Desktop Standard: 需要 Business Analyst
- ArcGIS Desktop Advanced: 需要 Business Analyst