FRAMES | NO FRAMES
CustomerStoreSetupByGeocodeTable Method

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.

TaskResultOutput CustomerStoreSetupByGeocodeTable ( 
    CustomerStoreSetupByGeocodeTableParameters  Parameters, 
    RenderingParameters                         RenderingParameters, 
    TaskOutputType[]                            OutputTypes, 
    esriFolderItem                              OutputAnalysisItem 
);

Parameter Description
Parameters Configuration options for customer/store setup. Type CustomerStoreSetupByGeocodeTableParameters.
RenderingParameters Configuration options for rendering output when GetMapImage option is specified in the OutputTypes parameter. Type RenderingParameters.
OutputTypes Array of task output options. Options for this method include rendering output image (GetMapImage) and creating a feature layer for subsequent analysis (GetFeatureClass). Type TaskOutputType[].
OutputAnalysisItem (Optional parameter — can be null).
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.

Returns

Variable of type TaskResultOutput

Remarks

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

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

How Does it Work

The CustomerStoreSetupByGeocodeTable method 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 fall back 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 might contain names of people that share the same address. For example, you may have multiple customer records from a single apartment building.

Examples

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.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
baServerHelper.ActiveDatasetID = "USA_ESRI"; // Optional parameter
baServerHelper.IsFullErrorMessage = true;    // Default is false
 
RenderingParameters imageOptions;
TaskOutputType[] outputOptions;
esriFolderItem outputLayer;
 
// ========= STEP 1: Create a record set by store addresses
 
RecordSetByAddress[] storeAddresses = new RecordSetByAddress[2];
 
storeAddresses[0] = new RecordSetByAddress();
storeAddresses[0].Name = "store1";
storeAddresses[0].Description = "Redlands Office";
storeAddresses[0].StoreID = "1";
storeAddresses[0].Address = "380 New York St.";
storeAddresses[0].City = "Redlands";
storeAddresses[0].State = "CA";
storeAddresses[0].ZIP = "92373";
 
storeAddresses[1] = new RecordSetByAddress();
storeAddresses[1].Name = "store2";
storeAddresses[1].Description = "La Jolla Office";
storeAddresses[1].StoreID = "2";
storeAddresses[1].Address = "3252 Holiday Court";
storeAddresses[1].City = "La Jolla";
storeAddresses[1].State = "CA";
storeAddresses[1].ZIP = "92037";
 
TaskResultOutput recordSetResult =
    baServerHelper.CreateRecordSetByAddresses(storeAddresses, esriFolderType.esriFolderStoreLayers);
 
TableData tableData = new TableData();
tableData.RecordSet = recordSetResult.RecordSet;
GeocodeData geocodeData = new GeocodeData();
geocodeData.Table = tableData;
 
// ========= STEP 2: Geocode the record set with stores
 
CustomerStoreSetupByGeocodeTableParameters parameters = new CustomerStoreSetupByGeocodeTableParameters();
 
// Set specific analysis parameters
parameters.GeocodeCustomers = false;
parameters.GeocodeData = geocodeData;
parameters.NameField = "NAME";
parameters.StoreIDField = "STORE_ID";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
 
// In general, a non-null esriFolderItem is specified to save a newly-created
// item to the server-side repository or to reference an existing item in it.
outputLayer = new esriFolderItem();
outputLayer.folderType = esriFolderType.esriFolderStoreLayers;
outputLayer.itemName = "storeLayer_CustomerStoreSetupByGeocodeTable";
outputLayer.workspaceName = "Default Workspace";
outputLayer.projectName = "Default Project";
 
TaskResultOutput result =
    baServerHelper.CustomerStoreSetupByGeocodeTable(parameters, imageOptions, outputOptions, outputLayer);

See Also