FRAMES | NO FRAMES
GamePlanMap Method

Divides sites in the area of interest into one of four categories and thematically shades each site based on the output from the Game Plan Chart.

Availability: Business Analyst Server.

TaskResultOutput GamePlanMap ( 
    GamePlanMapParameters  Parameters, 
    esriReportFormat       ReportFormat,
    RenderingParameters    RenderingParameters,	
    TaskOutputType[]       OutputTypes, 
    esriFolderItem         OutputAnalysisItem,
    esriFolderItem         OutputReportItem	
); 

Parameter Description
Parameters Configuration options for analysis. Type GamePlanMapParameters.
ReportFormat This parameter should be null. This parameter is deprecated.
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 creating a report (GetReport). 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.
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 GamePlanMap method creates a thematically shaded map from a geography level and from the result of a Game Plan Chart in which a target profile is compared to a base profile.

The Game Plan Chart, also referred to as a four-quadrant chart, is an adaptation of the standard scatter-plot chart. The chart displays the results of a profile comparison report. The x-axis is based on the percent composition of the target profile, and the y-axis is based on the index values of each segment. The sample chart below graphs the Tapestry segments based on their index and percent composition values.

The Game Plan Chart is divided into four quadrants: Core, Developmental, Niche, and Other. Each of the four quadrants is explained below.

Usage Tips

How Does it Work

The sample graph below illustrates how the GamePlanMap method works. It assigns a color to every site of a geography level based on its segmentation assignment and on belonging its segment to a quadrant of the Game Plan Chart. In the example below, a section of block groups in San Francisco, California, have been mapped in conjunction with the graph above. All the sites that fall into the Core quadrant are within the dark blue section of the graph.

Examples

The example below illustrates a workflow to create a Game Plan Chart report. This workflow includes the preliminary steps of creating of a target customer profile from a table of customers and their cumulative purchase amounts and creation of a base profile for the sales territory. Also, both profiles are stored in the repository.

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;
esriFolderItem outputItem;
 
// ========= STEP 1: Create a target segmentation profile by the table of customers
 
RecordSet table = new RecordSet();
 
// Create table fields
string[] fieldNames = new string[] {
    "CUST_ID", "NAME", "ADDRESS", "CITY", "STATE", "ZIP", "STORE_ID", "SALES"
};
table.Fields = new Fields();
table.Fields.FieldArray = new Field[fieldNames.Length];
for (int i = 0; i < fieldNames.Length; i++)
{
    Field field = new Field();
    field.Name = fieldNames[i];
    field.Type = esriFieldType.esriFieldTypeString;
    table.Fields.FieldArray[i] = field;
}
// The last field is numeric
table.Fields.FieldArray[fieldNames.Length - 1].Type = esriFieldType.esriFieldTypeInteger;
 
// Create table records
table.Records = new Record[5];
table.Records[0] = new Record();
table.Records[0].Values = new object[] {
    "101", "CUST1", "2355 Pine St.", "San Francisco", "CA", "94115", "1", 12343
};
table.Records[1] = new Record();
table.Records[1].Values = new object[] {
    "102", "CUST2", "2501 California St.", "San Francisco", "CA", "94115", "1", 10008
};
table.Records[2] = new Record();
table.Records[2].Values = new object[] {
    "103", "CUST3", "563 Ruger St.", "San Francisco", "CA", "94129", "2", 3200
};
table.Records[3] = new Record();
table.Records[3].Values = new object[] {
    "104", "CUST4", "301 Finley Rd.", "San Francisco", "CA", "94129", "2", 15802
};
table.Records[4] = new Record();
table.Records[4].Values = new object[] {
    "105", "CUST5", "614 Balboa St.", "San Francisco", "CA", "94129", "2", 4750
};
 
TableData tableData = new TableData();
tableData.RecordSet = table;
 
// Specify geocode data
GeocodeData geocodeData = new GeocodeData();
geocodeData.Table = tableData;
 
ProfileByTableGeocodingParameters targetProfileParameters = new ProfileByTableGeocodingParameters();
 
// Set specific analysis parameters
targetProfileParameters.GeocodeData = geocodeData;
targetProfileParameters.SegmentationBase = "Total Households";
targetProfileParameters.WeightField = "SALES";
 
// Set other parameters
// 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.
outputItem = new esriFolderItem();
outputItem.folderType = esriFolderType.esriFolderSegProfiles;
outputItem.itemName = "targetProfile_GamePlanMap";
outputItem.projectName = "Default Project";
outputItem.workspaceName = "Default Workspace";
 
string targetProfile = baServerHelper.ProfileByTableGeocoding(targetProfileParameters, outputItem);
 
ProfileData targetProfileData = new ProfileData();
targetProfileData.Description = targetProfile;
 
// ========= STEP 2: Create a boundary layer from standard geographies
 
// The San Francisco County study area is selected as the boundary.
StandardLevelsOfGeographyParameters geographyParameters = new StandardLevelsOfGeographyParameters();
 
// Set specific analysis parameters
geographyParameters.GeographyFeaturesBehavior = esriStdGeographyType.esriStdGeographyTypeFirst;
geographyParameters.GeographyIDs = new string[] { "06075" }; // FIPS ID code for San Francisco County
geographyParameters.GeographyLevelID = "US.Counties";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
outputLayer = null;
outputReport = null;
 
TaskResultOutput geographyResult =
    baServerHelper.StandardLevelsOfGeography(geographyParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer boundaryLayer = new DataLayer();
boundaryLayer.RecordSet = geographyResult.RecordSet;
 
// ========= STEP 3: Create a base segmentation profile by the boundary layer
 
ProfileByAreaSummationParameters baseProfileParameters = new ProfileByAreaSummationParameters();
 
// Set specific analysis parameters
baseProfileParameters.AreaIDField = "AREA_ID";
baseProfileParameters.Boundaries = boundaryLayer;
baseProfileParameters.SegmentationBase = "Total Households";
 
// Set other parameters
// 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.
outputItem = new esriFolderItem();
outputItem.folderType = esriFolderType.esriFolderSegProfiles;
outputItem.itemName = "baseProfile_GamePlanMap";
outputItem.projectName = "Default Project";
outputItem.workspaceName = "Default Workspace";
 
string baseProfile = baServerHelper.ProfileByAreaSummation(baseProfileParameters, outputItem);
 
ProfileData baseProfileData = new ProfileData();
baseProfileData.Description = baseProfile;
 
// ========= STEP 4: Execute the analysis
 
PolygonN polygon = (PolygonN)boundaryLayer.RecordSet.Records[0].Values[1];
ExtentData extentData = new ExtentData();
extentData.Extent = polygon.Extent;
 
GamePlanMapParameters parameters = new GamePlanMapParameters();
 
// Set specific analysis parameters
parameters.AnalysisExtent = extentData;
parameters.BaseProfile = baseProfileData;
parameters.DefineSegmentsExplicitly = false;
parameters.IndexThreshold = 200;
parameters.PercentThreshold = 10;
parameters.SegmentationBase = "Total Households";
parameters.SegmentationLevel = "US.BlockGroups";
parameters.TargetProfile = targetProfileData;
 
// 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 = "Game Plan Map Report for customers table";
parameters.StandardReportOptions = reportOptions;
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetReport, TaskOutputType.GetFeatureClass };
outputReport = null;
 
// 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.esriFolderAnalyses;
outputLayer.itemName = "analysisLayer_GamePlanMap";
outputLayer.projectName = "Default Project";
outputLayer.workspaceName = "Default Workspace";
 
TaskResultOutput result =
    baServerHelper.GamePlanMap(parameters, imageOptions, outputOptions, outputLayer, outputReport);
 
string reportURL = result.Reports[0].ReportURL;

See Also