Disponible con licencia de Business Analyst.
Resumen
Creates a series of lines from each customer to an associated store location. These lines are often called spider diagrams.
Ilustración
![Desire Lines wide Desire Lines wide](GUID-794F3AB4-7225-4E87-850A-B3B9084F083D-web.gif)
Uso
In most cases, the input Store Layer will be a Business Analyst store layer.
The Store Layer must be a point feature class.
In ArcMap, desire lines will only be drawn to customer points that are within the active study area or analysis extent. If you want to draw desire lines to all customer points, make sure that all customers are within the analysis extent.
Creating desire lines with drive time and drive distance will take significantly longer than using the straight-line (Euclidean) distance method.
Check the Add Distance to Customer Layer check box if you want to append the distance from the customer point to the associated store location for each customer record.
Only customers in the active extent or study area will be used in this analysis.
Use the Assign By Closest Stores Location or Assign By Trade Area tools in the Customer Setup toolset if your customers are not assigned to a store location.
Sintaxis
arcpy.ba.DesireLines(InputFeatureLayer, IDField, All_Or_Single_Or_Selected, CustomerLayer, LinkField, DistanceCalculateMethod, MeasureUnitsForDistanceField, OutputFeatureClass, {ByID_Or_ByName}, {Single_Site}, {UseSelectedFeatures}, {ExcludeOutlyingCustomers}, {CutOffDistance}, {MeasureUnits}, {AddDistanceToBusiness}, {WayToDefineDistanceField}, {DesireLinesDistanceField}, {NameField}, {BarrierFeatureClasses})
Parámetro | Explicación | Tipo de datos |
InputFeatureLayer | The input feature layer containing the center points for the desire lines. Desire lines are drawn from these features. | Feature Layer |
IDField | Field used to uniquely identify each store. | Field |
All_Or_Single_Or_Selected | Runs a desire line analysis on one or more stores.
| String |
CustomerLayer | Contains the customer points for the desire lines. Desire lines are drawn from the store to these features. | Feature Layer |
LinkField | The store ID field in the customer layer that assigns each customer to a store. | Field |
DistanceCalculateMethod | The method used to derive length of each desire line.
| String |
MeasureUnitsForDistanceField | The units used with the distance values.
| String |
OutputFeatureClass | The feature class that will contain the desire lines. | Feature Class |
ByID_Or_ByName (Opcional) | Field used to select a single point.
| String |
Single_Site (Opcional) | ID or name of store that is to be used as the single point. | String |
UseSelectedFeatures (Opcional) | Uses only selected features to generate the desire lines.
| Boolean |
ExcludeOutlyingCustomers (Opcional) | Allows you to set a cutoff distance to remove outlying points from the analysis.
| Boolean |
CutOffDistance (Opcional) | The threshold to exclude outlying customers from the analysis. | Double |
MeasureUnits (Opcional) | The units used with the distance values. By default, the units defined in the Business Analyst preferences will be selected.
| String |
AddDistanceToBusiness (Opcional) | Adds a new field that will contain the distance calculated to each store for each customer record.
| Boolean |
WayToDefineDistanceField (Opcional) | Uses an existing distance field in the customer layer to store the length of each desire line.
| Boolean |
DesireLinesDistanceField (Opcional) | The field that will contain the distance calculated in the analysis. | String |
NameField (Opcional) | This field contains the store name which is typically in a string format. | Field |
BarrierFeatureClasses [BarrierFeatureClasses,...] (Opcional) | Allows a user to place point, line, or polygon barriers when using drive time or drive distance algorithms to calculate distances. | Feature Layer |
Muestra de código
DesireLines example (stand-alone script)
# Name: DesireLines.py
# Description: Creates a spider diagram between stores and customers in San Francisco using a straight line distance calculation.
# 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 the parameters for the Desire Lines tool
InputFeatureLayer = "Default Group Layer/sf_stores"
IDField = "STORE_ID"
All_Or_Single_Or_Selected = "ALL"
CustomerLayer = "Default Group Layer/sf_custs"
LinkField = "STORE_ID"
DistanceCalculateMethod = "STRAIGHT_LINE_DISTANCE"
MeasureUnitsForDistanceField = "Miles"
OutputFeatureClass = "C:\My Output Data\Projects\Default Project\Analyses\DesireLines_4\StoreLayer_DesireLines.shp"
# Create Desire Line output file
arcpy.DesireLines_ba(InputFeatureLayer,
IDField,
All_Or_Single_Or_Selected,
CustomerLayer,
LinkField,
DistanceCalculateMethod,
MeasureUnitsForDistanceField,
OutputFeatureClass)
# Release extension license
arcpy.CheckInExtension("Business")
Entornos
Esta herramienta no utiliza ningún entorno de geoprocesamiento.
Información de licenciamiento
- Basic: Requiere Business Analyst
- Standard: Requiere Business Analyst
- Advanced: Requiere Business Analyst