FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.2   R E S T   C U S T O M E R / S T O R E    S E T U P    T A S K

Customer/Store Setup by Geocode Table Endpoint

Creates a store or customer layer from a table containing street address information. This is often the first step in a Business Analyst analysis workflow.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/CustomerStoreSetupByGeocodeTable/execute

Specific Parameters

Parameter

Description

GeocodeData (required)

Table containing address information for geocoding. Type GeocodeData.

CreateNewIDField (optional)

An option specifying the use of existing store ID field or creation a new store ID field for Store Setup. Type boolean.

Default: false.

GeocodeCustomers (optional)

An option specifying the setup type. Type boolean.

Default: true.

LinkField (optional)

The name of field for Customer Setup to be used for assignment customers with stores or trade areas. Type string.

NameField (optional)

Store/customer name field. Type string.

StoreIDField (optional)

Store ID field name for Store Setup. Type string.

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this endpoint include rendering an output image (GetMapImage) and/or creating a feature layer for subsequent analysis (GetFeatureClass). Type array of TaskOutputType.

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

f (optional)

Response format. Type string. Available formats: HTML, JSON, PJSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

OutputAnalysisItem (optional)

Configuration options for storing the output feature layer in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputSpatialReference (optional)

An option specifying the spatial reference to return the output feature layer. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference.

RenderingParameters (optional)

Configuration options for rendering output when GetMapImage option is specified in the OutputType parameter. Type RenderingParameters.

ReturnGeometry (optional)

An option specifying the presence of the shape attribute in the returned record set. Type boolean.

Default: true.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type TaskResultOutput

Remarks

Use the Customer/Store Setup to define and generate a new customer/store layer, an object that includes information about your customers, stores, branches, or offices. Once you define a customer/store layer, you can use it later in a map, analysis, or report.

 

To define a customer/store layer, the Customer/Store Setup by Geocode Table endpoint uses geo-intelligent information contained in the input GeocodeData. Before performing this task, you may need to create a table and import it to Business Analyst Server repository.

 

Address information for Customer/Store Setup is specified with GeocodeData parameter.

 

The GeocodeCustomers parameter specifies the Setup type: the true value (default) means Customer Setup and the false value means Store Setup.

 

For Customer Setup, the NameField and LinkField parameters can be specified. A new customer ID field is created.

 

For Store Setup, the StoreIDField parameter should be specified. The CreateNewIDField parameter specifies whether to create a new store ID field or not. If its value is true, a new store ID field is added to the output layer with the name specified by the StoreIDField parameter. If this name already exists in the input fields, it is slightly modified to be unique. For example, if the input data already contains a field with STORE_ID name and you try to create a new store ID field with the same name, a new field with the STORE_ID_1 name will be created in the output layer.

How Does it Work

The Customer/Store Setup by Geocode Table endpoint will geocode table points by Address/City/State/ZIP(optional), Address/ZIP, ZIP, or ZIP+4. The more information you provide, the better your geocoding results will be.

 

Geocoding by ZIP Code places the customer/store points at the center point (centroid) of the ZIP Code. If you use this approach, the customer/store point locations will be less accurate than geocoding by address, city, and state. When customer points are geocoded, multiple points can be geocoded at one location because the customer file contains names of people that share the same address. For example, you may have multiple customer records from a single apartment building.

Example Usage

The example below sets up a store feature layer using a list of addresses. This is often executed as a preliminary step in an analysis workflow.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/CustomerStoreSetupByGeocodeTable/execute?
GeocodeData={
  "Table":{"RecordSet":{"features":[
    {
      "geometry":{},
      "attributes":{
        "OID":1,
        "STORE_ID":"1",
        "NAME":"store1",
        "DESCR":"Redlands Office",
        "ADDRESS":"380 New York St.",
        "CITY":"Redlands",
        "STATE":"CA","ZIP":"92373"
      }
    },
    {
      "geometry":{},
      "attributes":{
        "OID":2,
        "STORE_ID":"2",
        "NAME":"store2",
        "DESCR":"La Jolla Office",
        "ADDRESS":"3252 Holiday Court",
        "CITY":"La Jolla",
        "STATE":"CA",
        "ZIP":"92037"
      }
    }
  ]}}
}&GeocodeCustomers=false&
StoreIDField=STORE_ID&
NameField=NAME&
OutputType=GetFeatureClass&
f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPoint",
        "spatialReference":
        {
          "wkid":4326
        },
        "fieldAliases":
        {
          "OBJECTID":"Object ID",
          "Loc_name":"Loc_name",
          "Status":"Status",
          "Score":"Score",
          "Side":"Side",
          "X":"X",
          "Y":"Y",
          "Match_addr":"Match_addr",
          "Block":"Block",
          "BlockL":"BlockL",
          "BlockR":"BlockR",
          "ADDRESS":"ADDRESS",
          "CITY":"CITY",
          "DESCR":"DESCR",
          "NAME":"NAME",
          "OID_":"OID_",
          "STATE":"STATE",
          "STORE_ID":"STORE_ID",
          "ZIP":"ZIP",
          "ST_DESC":"ST_DESC",
          "STORE_ADDR":"STORE_ADDR",
          "STORE_LAT":"STORE_LAT",
          "STORE_LONG":"STORE_LONG"
        },
        "fields":
        [
          {
            "name":"OBJECTID",
            "type":"esriFieldTypeOID",
            "alias":"Object ID"
          },
          ...
          {
            "name":"STORE_LONG",
            "type":"esriFieldTypeDouble",
            "alias":"STORE_LONG"
          }
        ],
        "features":
        [
          {
            "geometry":
            {
              "x":-117.195236342652,
              "y":34.0571858947312,
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":1,
              "Loc_name":"Address_Points",
              "Status":"M",
              "Score":100,
              "Side":"L",
              "X":-117.195239131347,
              "Y":34.0571894359296,
              "Match_addr":"380 NEW YORK ST, REDLANDS, CA, 92373",
              "Block":"060710081002007",
              "BlockL":"",
              "BlockR":"",
              "ADDRESS":"380 New York St.",
              "CITY":"Redlands",
              "DESCR":"Redlands Office",
              "NAME":"store1",
              "OID_":1,
              "STATE":"CA",
              "STORE_ID":"1",
              "ZIP":"92373",
              "ST_DESC":"",
              "STORE_ADDR":"380 NEW YORK ST, REDLANDS, CA, 92373",
              "STORE_LAT":34.0571894359296,
              "STORE_LONG":-117.195239131347
            }
          },
          {
            "geometry":
            {
              "x":-117.232603173142,
              "y":32.8708902004001,
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":2,
              "Loc_name":"Address_Points",
              "Status":"M",
              "Score":100,
              "Side":"L",
              "X":-117.232605961664,
              "Y":32.87089374708,
              "Match_addr":"3252 HOLIDAY CT, LA JOLLA, CA, 92037",
              "Block":"060730083151000",
              "BlockL":"",
              "BlockR":"",
              "ADDRESS":"3252 Holiday Court",
              "CITY":"La Jolla",
              "DESCR":"La Jolla Office",
              "NAME":"store2",
              "OID_":2,
              "STATE":"CA",
              "STORE_ID":"2",
              "ZIP":"92037",
              "ST_DESC":"",
              "STORE_ADDR":"3252 HOLIDAY CT, LA JOLLA, CA, 92037",
              "STORE_LAT":32.87089374708,
              "STORE_LONG":-117.232605961664
            }
          }
        ]
      }
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.

 

JSON Response Example Rendered with the ArcGIS API for JavaScript

Example Usage Rendering

See Also

Match Level Summary Report Endpoint

Customer/Store Setup by Coordinates Endpoint

Business Analyst Server REST Reference