B U S I N E S S A N A L Y S T 10.2 R E S T R E P O R T T A S K
Locator Report Endpoint
Generates a report based on the relation of stores to competitors.
Availability: Business Analyst Server.
http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/LocatorReport/execute
Specific Parameters
BusinessesSearchMethod (required) |
Method of search for nearest competitors. Type esriBusinessesSearchMethod. |
BusinessPoints (required) |
Point layer with competitors' business points. Type PointLayer. |
CalculationMethod (required) |
Distance calculation method. Type esriDistanceCalcType. |
FieldAliases (required) |
Aliases of fields to be shown in the report—up to four fields for a portrait report and up to six fields for a landscape report. Type array of string. |
FieldNames (required) |
Fields of the BusinessPoints layer to be exported to the report—up to four fields for a portrait report and up to six fields for a landscape report. Type array of string. |
Stores (required) |
A point layer containing point features such as businesses, hospitals, schools, etc. which represent the locations of your businesses. Type PointLayer. |
AnalysisExtent (optional) |
Analysis extent. Type ExtentData. |
ClosestBusinessesCount (optional) |
Closest businesses count threshold. Type int. |
DistanceUnits (optional) |
Units to report distances. For drive time calculation method, this property is ignored and the distances in minutes are displayed in the report. Type esriUnits. Default: esriMiles. |
NearestDistance (optional) |
Nearest distance threshold. Type double. |
NearestDistanceUnits (optional) |
Units the NearestDistance property value is measured. Type esriUnits. |
ReportOrientation (optional) |
Orientation of the report. Type esriReportOrientation. Default: esriReportOrientationPortrait. |
SingleStoreID (optional) |
ID of a single store to generate report. Type string. |
StoreIDField (optional) |
The attribute field name in the input Stores layer which is associated with unique store/business IDs (typically store numbers for retail establishments with multiple locations). Type string. Default: STORE_ID. |
StoreNameField (optional) |
The attribute field name in the input Stores layer which is associated with store/business names. Type string. Default: NAME. |
Other Parameters
OutputType (required) |
Array of task output options. Options for this endpoint include rendering an output image (GetMapImage), creating a feature layer for subsequent analysis (GetFeatureClass), and creating a report (GetReport). 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. |
OutputReportItem (optional) |
Configuration options for storing the output report 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 in. 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. |
StandardReportOptions (optional) |
Report parameters. Type ReportOptions. The TemplateName parameter is ignored. |
token |
Authentication token. This parameter is required if your Business Analyst Server is secured. Type string. |
Returns
Variable of type TaskResultOutput
Remarks
The Locator Report endpoint generates a report that will determine the proximity of locations to a given set of center points. For example, you can use this method to illustrate the proximity of competitors to each store location. This report will list and display all the competitor locations that are closest to each store and allows you to examine their geographic patterns and distribution.
The analysis can be restricted to an analysis extent if the AnalysisExtent parameter is specified. Optional SingleStoreID parameter restricts the analysis to a single store of the store layer.
The BusinessesSearchMethod parameter specifies the algorithm for selection business points nearest to every store location:
• esriFindClosest—Selects no more than the closest business points specified with the ClosestBusinessesCount parameter.
• esriWithinRange—Selects all business points that fall within a predefined distance specified with the NearestDistance and NearestDistanceUnits parameters. For example, you can select all business points that are within five miles of each store location.
The CalculationMethod parameter specifies a method for distance calculation from within drive time, drive distance, or straight-line distance variants.
The locator report can be generated in the portrait or landscape mode specified with the ReportOrientation parameter. In the portrait mode, the number of attributes of business points shown in columns is limited to four. In the landscape mode, up to six attributes of business points can be shown. The attribute fields of the business layer to be exported to the report and their alias names to be shown in captions of columns are specified with the FieldNames and FieldAliases parameter, respectively.
Example Usage
The example below generates a Locator Report between two store locations and four customer locations.
{ "results": [ { "paramName": "RecordSet", "dataType": "GPFeatureRecordSetLayer", "value": { "displayFieldName": "", "fieldAliases": { "ID": "ID", "NAME": "NAME", "OBJECTID": "Object ID", "Latitude": "Latitude", "Longitude": "Longitude", "STORE_ID": "STORE_ID", "NAME_1": "NAME_1", "DESCR": "DESCR", "STORE_ADDR": "STORE_ADDR", "DISTANCE": "DISTANCE", "DIRECTION": "DIRECTION" }, "geometryType": "esriGeometryPoint", "spatialReference": { "wkid": 4326, "latestWkid": 4326 }, "fields": [ { "name": "ID", "type": "esriFieldTypeString", "alias": "ID", "length": 256 }, { "name": "NAME", "type": "esriFieldTypeString", "alias": "NAME", "length": 32 }, ... { "name": "DIRECTION", "type": "esriFieldTypeString", "alias": "DIRECTION", "length": 32 } ], "features": [ { "attributes": { "ID": "125", "NAME": "Store Name1", "OBJECTID": 1, "Latitude": 37.735999999999997, "Longitude": -122.482, "STORE_ID": "122", "NAME_1": "Alex Smith", "DESCR": "Description 1", "STORE_ADDR": "", "DISTANCE": 5.6319378335028887, "DIRECTION": "SW" }, "geometry": { "x": -122.482, "y": 37.736000000000004 } }, ... { "attributes": { "ID": "122", "NAME": "Store Name2", "OBJECTID": 8, "Latitude": 37.658000000000001, "Longitude": -122.447, "STORE_ID": "122", "NAME_1": "John Smith", "DESCR": "Description 4", "STORE_ADDR": "", "DISTANCE": 6.4821301968768239, "DIRECTION": "SW" }, "geometry": { "x": -122.447, "y": 37.658000000000001 } } ] } }, { "paramName": "LocatorP.PDF", "dataType": "GPDataFile", "value": { "url": "http://localhost:6080/arcgis/rest/directories/arcgisoutput/DefaultMap_MapServer/_ags_T16308D99E411E93292F5BA476634E.pdf" } } ], "messages": [ ] }
NOTE: The response has been abbreviated where "..." is noted.
JSON Response Example Rendered with the ArcGIS API for JavaScript
See Also