ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Desire Lines

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

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

Illustration

Desire Lines wide

Usage

  • 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 checkbox 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.

Syntax

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})
ParameterExplanationData Type
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.

  • ALL —Runs analysis on all stores. This is the default.
  • SINGLE —Runs 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_TIME —Driving time measured in units of time.
  • DRIVE_DISTANCE —Driving distance measured in units of distance.
  • STRAIGHT_LINE_DISTANCE —Straight-line distance. This is the default.
String
MeasureUnitsForDistanceField

The units used with the distance values.

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

The feature class that will contain the desire lines.

Feature Class
ByID_Or_ByName
(Optional)

Field used to select a single point.

  • ID —Selects a single point using the store ID field.
  • Name —Selects a single point using the store name field.
String
Single_Site
(Optional)

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

String
UseSelectedFeatures
(Optional)

Uses only selected features to generate the desire lines.

  • True —Generates desire lines on selected features.
  • False —Generates desire lines on all features.
Boolean
ExcludeOutlyingCustomers
(Optional)

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

  • True —Excludes outlying customers.
  • False —Includes outlying customers.
Boolean
CutOffDistance
(Optional)

The threshold to exclude outlying customers from the analysis.

Double
MeasureUnits
(Optional)

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
  • Miles —This is the default.
  • Nautical Miles
  • Yards
String
AddDistanceToBusiness
(Optional)

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

  • True —Adds a distance field to the customer layer.
  • False —Does not add a distance field to the customer layer. This is the default.
Boolean
WayToDefineDistanceField
(Optional)

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

  • CREATE_NEW —Creates a new attribute field for distance. This is the default.
  • USE_EXISTING —Uses an existing attribute field for distance.
Boolean
DesireLinesDistanceField
(Optional)

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

String
NameField
(Optional)

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

Field
BarrierFeatureClasses
[BarrierFeatureClasses,...]
(Optional)

Allows a user to place point, line, or polygon barriers when using drive time or drive distance algorithms to calculate distances.

Feature Layer

Code Sample

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 arcgisscripting

# Import system modules

import arcview
import arcpy

arcpy.ImportToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.3\Business Analyst\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)

Environments

This tool does not use any geoprocessing environments

Licensing Information

  • ArcGIS for Desktop Basic: Requires Business Analyst
  • ArcGIS for Desktop Standard: Requires Business Analyst
  • ArcGIS for Desktop Advanced: Requires Business Analyst

Related Topics

  • An overview of the Business Analyst Analysis toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal