Assign Customers By Distance (Business Analyst)

Disponible con licencia de Business Analyst.

Resumen

Assigns customers to the closest store based on a selected distance type.

Uso

  • The ID of the closest store is assigned to each customer. Store assignments are influenced by the selected value for Distance Type.

  • An Origin-Destination matrix calculates the least-cost paths between customers and stores using the Business Analyst network dataset and routing service.

  • When using a network distance type, you can adjust the Search Tolerance parameter value to define the maximum distance the input customer features can be from a road. Customer points beyond this distance will not receive a store assignment.

  • If a store cannot be assigned to a customer point, the new Store ID value will be null and the Distance value will contain a -1.

Parámetros

EtiquetaExplicaciónTipo de datos
Input Customer Features

The input point feature layer representing customers.

Feature Layer
Input Store Features

The input point feature layer representing store or facilities.

Feature Layer
Store ID Field

A unique ID field for Input Store Features.

Field
Output Feature Class

A point layer containing customers with assigned store or facility and distance.

Feature Class
Field Name
(Opcional)

A new field that contains the assigned store or facility ID.

String
Distance Type
(Opcional)

The method of travel used to calculate the distance between customers and stores.

String
Distance Units
(Opcional)

The units that will be used to measure the selected distance type.

String
Travel Direction
(Opcional)

Specifies the direction of travel that will be used between stores or facilities and customers.

  • Toward StoresThe direction of travel will be from customers to stores. This is the default.
  • Away from StoresThe direction of travel will be from stores to customers.
String
Time of Day
(Opcional)

The time and date that will be used when calculating distance.

Date
Time Zone
(Opcional)

Specifies the time zone that will be used for the Time of Day parameter.

  • Time Zone at LocationThe time zone in which the territories are located will be used. This is the default.
  • UTCCoordinated universal time (UTC) will be used.
  • Time Zone at LocationThe time zone in which the territories are located will be used. This is the default.
  • UTCCoordinated universal time (UTC) will be used.
String
Search Tolerance
(Opcional)

The maximum distance that input points can be from the network. Points located beyond the search tolerance will be excluded from processing.

The parameter requires a distance value and units for the tolerance. The default value is 5000 meters.

Linear Unit

arcpy.ba.AssignCustomersByDistance(in_features, in_store_features, store_id_field, out_feature_class, {link_field}, {distance_type}, {distance_units}, {travel_direction}, {time_of_day}, {time_zone}, {search_tolerance})
NombreExplicaciónTipo de datos
in_features

The input point feature layer representing customers.

Feature Layer
in_store_features

The input point feature layer representing store or facilities.

Feature Layer
store_id_field

A unique ID field for in_store_features.

Field
out_feature_class

A point layer containing customers with assigned store or facility and distance.

Feature Class
link_field
(Opcional)

A new field that contains the assigned store or facility ID.

String
distance_type
(Opcional)

The method of travel used to calculate the distance between customers and stores.

String
distance_units
(Opcional)

The units that will be used to measure the selected distance type.

String
travel_direction
(Opcional)

Specifies the direction of travel that will be used between stores or facilities and customers.

  • TOWARD_STORESThe direction of travel will be from customers to stores. This is the default.
  • AWAY_FROM_STORESThe direction of travel will be from stores to customers.
String
time_of_day
(Opcional)

The time and date that will be used when calculating distance.

Date
time_zone
(Opcional)

Specifies the time zone that will be used for the time_of_day parameter.

  • TIME_ZONE_AT_LOCATIONThe time zone in which the territories are located will be used. This is the default.
  • UTCCoordinated universal time (UTC) will be used.
String
search_tolerance
(Opcional)

The maximum distance that input points can be from the network. Points located beyond the search tolerance will be excluded from processing.

The parameter requires a distance value and units for the tolerance. The default value is 5000 meters.

Linear Unit

Muestra de código

AssignCustomersByDistance example (Python window)

The following Python window script demonstrates how to use the AssignCustomersByDistance function.

import arcpy
arcpy.ba.AssignCustomersByDistance("SF_Custs", "SF_Stores", "STORE_ID",
                                   r"C:\ArcGIS\Projects\MyProject.gdb\SF_Custs_AssignCustomersByDistance",
                                   "STORE_ID_1", "Driving Time", "MINUTES",
                                   "TOWARD_STORES", None,
                                   "TIME_ZONE_AT_LOCATION")

Información de licenciamiento

  • Basic: Requiere Business Analyst, Extensión ArcGIS Network Analyst
  • Standard: Requiere Business Analyst, Extensión ArcGIS Network Analyst
  • Advanced: Requiere Business Analyst, Extensión ArcGIS Network Analyst

Temas relacionados