FRAMES | NO FRAMES
AverageDriveTimeReport Method

Calculates the average drive time within trade areas.

Availability: Business Analyst Server 10.0 SP1.

TaskResultOutput AverageDriveTimeReport ( 
    AverageDriveTimeReportParameters  Parameters,
    esriReportFormat                  ReportFormat,
    TaskOutputType[]                  OutputTypes, 
    esriFolderItem                    OutputReportItem
); 

Parameter Description
Parameters Configuration options for analysis. Type AverageDriveTimeReportParameters.
ReportFormat This parameter should be null. This parameter is deprecated.
OutputTypes Array of task output options. Options for this method include creating a report (GetReport). Type TaskOutputType[].
OutputReportItem (Optional parameter — can be null).
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.

Returns

Variable of type TaskResultOutput

Remarks

The average drive time report allows you to analyze existing stores with associated customers and determine the average drive time of your customers in that market. This is commonly done utilizing the CustomerDerivedAreas method to define the extent of the market around your stores based on the number and distribution of your customers or based on some volumetric factor such as sales.

How Does it Work

Every trade area of the input Boundaries layer is analyzed as follows:

The result is an average drive time for each trade in the analysis. For example, if you ran a customer derived trade area of 40/60/80 percent of your customers, you will get a report that details the average drive time or drive distance for each of these three trade areas. This would allow you to determine how to best prospect a new location based on which of these trade areas best defined your core customers. You could simply take this average value(s) to seek new markets by generating drive times around potential new store sites and evaluate the demographics in that area to see if they match the demographics of a successful store.

Usage Tips

Examples

The example below generates a report for two trade areas using store locations as center points.

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
 
// You can specify below a domain of your local Business Analyst Server.
//baServerHelper.BAServerDomain = "esri.com";
 
// If a domain name is specified, a local server name in output URLs is replaced with the
// fully-addressable server name so people and machines outside the domain of your local
// Business Analyst Server instance can access these URLs.
 
RenderingParameters imageOptions;
TaskOutputType[] outputOptions;
esriFolderItem outputLayer;
esriFolderItem outputReport;
 
// Create a PointRecord array of 2 store locations.
PointRecord[] storePoints = new PointRecord[2];
 
storePoints[0] = new PointRecord();
storePoints[0].Name = "store_study_site1";
storePoints[0].Description = "VA Study Site";
storePoints[0].StoreID = "1";
storePoints[0].Latitude = 38.92903;
storePoints[0].Longitude = -77.246422;
 
storePoints[1] = new PointRecord();
storePoints[1].Name = "store_study_site2";
storePoints[1].Description = "CA Study Site";
storePoints[1].StoreID = "2";
storePoints[1].Latitude = 32.870293;
storePoints[1].Longitude = -117.232903;
 
// Create a store feature layer based on the array of point records.
PointLayer storeLayer = new PointLayer();
storeLayer.Points = storePoints;
 
// ========= STEP 1: Create 1-mile simple rings around stores
 
SimpleRingsParameters simpleRingsParameters = new SimpleRingsParameters();
 
// Set specific analysis parameters
simpleRingsParameters.DistanceUnits = esriUnits.esriMiles;
simpleRingsParameters.Radii = new double[] { 1 };
simpleRingsParameters.Stores = storeLayer;
 
// StoreIDField is useless for stores specified with array of PointRecord
//simpleRingsParameters.StoreIDField = "STORE_ID";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
outputLayer = null;
outputReport = null;
 
TaskResultOutput simpleRingsResult =
    baServerHelper.SimpleRings(simpleRingsParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer Boundaries = new DataLayer();
Boundaries.RecordSet = simpleRingsResult.RecordSet;
 
// ========= STEP 2: Execute the analysis
AverageDriveTimeReportParameters parameters = new AverageDriveTimeReportParameters();
 
// Set specific analysis parameters
parameters.AreaDescField = "AREA_DESC";
parameters.AreaLinkField = "STORE_ID";
parameters.Boundaries = Boundaries;
parameters.DistanceUnits = esriBADriveTimeUnits.esriDriveTimeUnitsMinutes;
parameters.Stores = storeLayer;
 
// StoreIDField is useless for stores specified with array of PointRecord
//parameters.StoreIDField = "STORE_ID";
 
// Set report options
ReportOptions reportOptions = new ReportOptions();
reportOptions.ReportFormat = "PDF";
reportOptions.ReportHeader = new KeyValue[1];
reportOptions.ReportHeader[0] = new KeyValue();
reportOptions.ReportHeader[0].Key = "subtitle";
reportOptions.ReportHeader[0].Value = "Average Drive Time Report for two rings";
parameters.StandardReportOptions = reportOptions;
 
// Set other parameters
outputReport = null;
 
TaskResultOutput result = baServerHelper.AverageDriveTimeReport(parameters, outputReport);
 
// Get the report URL
string reportURL = result.Reports[0].ReportURL;

See Also