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 Coordinates Endpoint
Creates a store or customer layer from records containing latitude (y) and longitude (x) information. This is often the first step in a Business Analyst analysis workflow.
Availability: Business Analyst Server.
http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/CustomerStoreSetupByCoordinates/execute
Specific Parameters
DataTable (optional) |
Data table. Type TableData. |
Points (optional) |
Array of point records. Type array of PointRecord. |
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. |
LatitudeFieldName (optional) |
Name of the latitude (y) field. Type string. Default: Latitude. |
LinkField (optional) |
The name of field for Customer Setup to be used for assignment customers with stores or trade areas. Type string. |
LongitudeFieldName (optional) |
Name of the longitude (x) field. Type string. Default: Longitude. |
NameField (optional) |
Store/customer name field. Type string. |
SpatialReference (optional) |
The spatial reference associated with points of this layer. Type SpatialReference. |
StoreIDField |
Store ID field name for Store Setup. Type string. |
Other Parameters
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.
When you need to identify a new location for a store, office or customer, you may have the exact map coordinates to the customer/store. If so, you can setup a new customer/store layer using this endpoint.
Point data for Customer/Store Setup is specified with either the DataTable or Points parameters. In the first case, the names of fields specified by parameters of this endpoint should match with fields from the input data table and the output layer will contain all fields specified in the input data table. In the last case, the customer/store layer will contain fields imported from PointRecord items.
The LatitudeFieldName and LongitudeFieldName parameters are used for identifying coordinate fields in the input record set specified with the DataTable object.
The spatial reference can be specified by the SpatialReference parameter. If this parameter is missing, Business Analyst Server default coordinate system is used.
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 NameField and CreateNewIDField parameters are optional.
Usage Tips
• This method allows you to create a customer/store layer based on the latitude (y) and longitude (x) coordinates of records.
• GPS collected data contain x,y coordinates. You can use this method to convert GPS collected data into customers/stores.
• Latitude and longitude coordinates that are in degrees minutes seconds (DMS) format must be converted to decimal degrees before using this method.
Example Usage
The example below sets up a store feature layer using a list of coordinates. This is often executed as a preliminary step in an analysis workflow.
{ "results": [ { "paramName":"OutputFeatureClass", "dataType":"GPFeatureRecordSetLayer", "value": { "geometryType":"esriGeometryPoint", "spatialReference": { "wkid":4326 }, "fieldAliases": { "OBJECTID":"Object ID", "Latitude":"Latitude", "Longitude":"Longitude", "STORE_ID":"STORE_ID", "NAME":"NAME", "DESCR":"DESCR", "STORE_ADDR":"STORE_ADDR" }, "fields": [ { "name":"OBJECTID", "type":"esriFieldTypeOID", "alias":"Object ID" }, ... { "name":"STORE_ADDR", "type":"esriFieldTypeString", "alias":"STORE_ADDR", "length":256 } ], "features": [ { "geometry": { "x":-80.27601, "y":25.794648, "spatialReference": { "wkid":4326 } }, "attributes": { "OBJECTID":1, "Latitude":25.794648, "Longitude":-80.27601, "STORE_ID":"1", "NAME":"MIA", "DESCR":"Miami International", "STORE_ADDR":"Adress 1" } }, ... { "geometry": { "x":-73.872073, "y":40.774328, "spatialReference": { "wkid":4326 } }, "attributes": { "OBJECTID":3, "Latitude":40.774328, "Longitude":-73.872073, "STORE_ID":"3", "NAME":"LGA", "DESCR":"New York La Guardia", "STORE_ADDR":"Adress 3" } } ] } } ], "messages": [ ] }
NOTE: The response has been abbreviated where "..." is noted.
JSON Response Example Rendered with the ArcGIS API for JavaScript
See Also