Desire Lines (Business Analyst)

汇总

Creates a series of lines from each customer to an associated store location. These lines are often called spider diagrams.

Learn more about how Desire Lines works

图示

Desire Lines wide

用法

语法

DesireLines_ba (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})
参数说明数据类型
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.

  • ALLRuns analysis on all stores. This is the default.
  • SINGLERuns analysis on a single store.
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.

  • DRIVE_TIMEDriving time measured in units of time.
  • DRIVE_DISTANCEDriving distance measured in units of distance.
  • STRAIGHT_LINE_DISTANCEStraight-line distance. This is the default.
String
MeasureUnitsForDistanceField

The units used with the distance values.

  • Decimal Degrees
  • Feet
  • Kilometers
  • Meters
  • MilesThis is the default.
  • Nautical Miles
  • Yards
String
OutputFeatureClass

The feature class that will contain the desire lines.

Feature Class
ByID_Or_ByName
(可选)

Field used to select a single point.

  • IDSelects a single point using the store ID field.
  • NameSelects a single point using the store name field.
String
Single_Site
(可选)

ID or name of store that is to be used as the single point.

String
UseSelectedFeatures
(可选)

Uses only selected features to generate the desire lines.

  • TrueGenerates desire lines on selected features.
  • FalseGenerates desire lines on all features.
Boolean
ExcludeOutlyingCustomers
(可选)

Allows you to set a cutoff distance to remove outlying points from the analysis.

  • TrueExcludes outlying customers.
  • FalseIncludes outlying customers.
Boolean
CutOffDistance
(可选)

The threshold to exclude outlying customers from the analysis.

Double
MeasureUnits
(可选)

The units used with the distance values. By default, the units defined in the Business Analyst preferences will be selected.

  • Decimal Degrees
  • Feet
  • Kilometers
  • Meters
  • MilesThis is the default.
  • Nautical Miles
  • Yards
String
AddDistanceToBusiness
(可选)

Adds a new field that will contain the distance calculated to each store for each customer record.

  • TrueAdds a distance field to the customer layer.
  • FalseDoes not add a distance field to the customer layer. This is the default.
Boolean
WayToDefineDistanceField
(可选)

Uses an existing distance field in the customer layer to store the length of each desire line.

  • CREATE_NEWCreates a new attribute field for distance. This is the default.
  • USE_EXISTINGUses an existing attribute field for distance.
Boolean
DesireLinesDistanceField
(可选)

The field that will contain the distance calculated in the analysis.

String
NameField
(可选)

This field contains the store name which is typically in a string format.

Field
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

代码示例

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.
import arcgisscripting

# Import system modules

import arcview
import arcpy

arcpy.ImportToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
 
try:
  # Acquire extension license 
  arcpy.CheckOutExtension("Business")
 
  # Define the parameters for the Desire Lines tool
  StorePath = "C:/temp/sf_stores.shp"
  CustPath = "C:/temp/sf_cust.shp"
  OutPath = "C:/temp/desire_lines.shp"
  StoreId = "STORE_ID"
  AssociatedStoreId = "STORE_ID"
 
  # Create Desire Line output file
  arcpy.DesireLines_ba(StorePath, StoreId, "ALL", CustPath, AssociatedStoreId, "STRAIGHT_LINE_DISTANCE", "Miles", OutPath)
 
  # Release extension license 
  arcpy.CheckInExtension("Business") 
 
except:
  print arcpy.GetMessages(2)

环境

此工具不使用任何地理处理环境

相关主题

许可信息

ArcView: 需要 Business Analyst
ArcEditor: 需要 Business Analyst
ArcInfo: 需要 Business Analyst

10/4/2010