Skip To Content

Generate Desire Lines

Available with Business Analyst license.

Summary

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

The tool output shows the spatial distribution between stores and customers and calculates the distance values between each store and customer.

Illustration

Generate Desire Lines

Usage

  • The store layer and customer layer must be a point feature class.

  • Creating desire lines with drive time and drive distance will take longer than using the straight-line (Euclidean) distance method.

Syntax

DesireLines_ba (in_stores_layer, in_customers_layer, out_feature_class, store_id_field, link_field, {distance_type}, {units}, {cutoff}, {travel_direction}, {time_of_day}, {time_zone})
ParameterExplanationData Type
in_stores_layer

Input point layer representing store or facility locations.

Feature Layer
in_customers_layer

Input point layer representing customers or patrons.

Feature Layer
out_feature_class

The resultant feature class that will be added to the Contents pane.

Feature Class
store_id_field

Unique ID representing a store or facility location.

Field
link_field

An ID used to assign individual customers to stores.

Field
distance_type
(Optional)

Defines how distance is calculated based on method of travel.

String
units
(Optional)

Defines the type of distance measuring units to be used when calculating minimal distance.

String
cutoff
(Optional)

The distance beyond which customers will be considered outliers, and therefore excluded from consideration during desire line creation.

Double
travel_direction
(Optional)

Specifies whether to measure travel times or distances from stores to demand points or from demand points to stores.

  • TOWARD_STORESDirection of travel is from stores to demand points. This is the default.
  • AWAY_FROM_STORESDirection of travel is from demand points to stores.
String
time_of_day
(Optional)

Specifies the time at which travel begins.

Date
time_zone
(Optional)

Specifies the time zone of the Time of Day parameter.

  • UTCThe Time of Day parameter refers to coordinated universal time (UTC). Choose this option if you want to choose the best location for a specific time, such as now, but aren't certain in which time zone the stores or demand points will be located.
  • TIME_ZONE_AT_LOCATIONThe Time of Day parameter refers to the time zone in which the stores or demand points are located. If Travel Direction is stores to demand points, this is the time zone of the stores. If Travel Direction is demand points to stores, this is the time zone of the demand points. This is the default.
String

Code sample

DesireLines example (stand-alone script)

The following Python window script demonstrates how to use the DesireLines tool.

import arcpy
arcpy.env.baDataSource = "ONLINE;US;"
arcpy.ba.DesireLines("Hubs", "grocery stores", r"C:\Temp\Output.gdb\Hubs_DesireLines", "Loc_name", "Loc_name", "STRAIGHT_LINE_DISTANCE", "MILES", 15, "TOWARD_STORES", None, "TIME_ZONE_AT_LOCATION")

DesireLines("Hubs", "grocery stores", r"C:\Temp\Output.gdb\Hubs_DesireLines", "Loc_name", "Loc_name", "STRAIGHT_LINE_DISTANCE", "MILES", 15, "TOWARD_STORES", None, "TIME_ZONE_AT_LOCATION")

Licensing information

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