FRAMES | NO FRAMES
StandardLevelsOfGeography Method

Generates trade areas based on standard geographic units.

Availability: Business Analyst Server.

TaskResultOutput StandardLevelsOfGeography ( 
    StandardLevelsOfGeographyParameters  Parameters, 
    esriReportFormat                     ReportFormat, 
    RenderingParameters                  RenderingParameters, 
    TaskOutputType[]                     OutputTypes, 
    esriFolderItem                       OutputAnalysisItem, 
    esriFolderItem[]                     OutputReportItems
);

Parameter Description
Parameters Configuration options for analysis. Type StandardLevelsOfGeographyParameters.
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 rendering output image (GetMapImage), creating a feature layer for subsequent analysis (GetFeatureClass), and 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.
OutputReportItems (Optional parameter - can be null).
Array of configuration options for storing the output reports in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem[]. Available with Business Analyst Server 10.0.

Returns

Variable of type TaskResultOutput

Remarks

The StandardLevelsOfGeography method allows you to generate trade areas based on predefined geographies. These geographies can be Esri standard demographic layers or any user generated polygon layers.

To select standard geography records, a data table with geographic IDs must be generated from which to create the trade areas. This table will be used to select the IDs from the geography layer. Once selected, the features will be exported as a new feature layer.

For example, if you want to generate trade areas based on a list of ZIP Codes, you would start by creating a table with all the ZIP Code records you want included in the table. This table may be a territory assignment file created by an external process. The ZIP Code records are then matched to the ZIP Code boundaries provided with the Business Analyst, and a trade area is created with all matching ZIP Codes.

All non-matching ZIP Codes will not be included in the output trade area. Non-matching ZIP Codes are ZIP Code records in the Table Containing Matching Geography IDs that are not valid and do not have a corresponding feature in the input geography layer.

NOTE: Since Business Analyst Server 10.0, the OutputReportItem parameter is replaced with the OutputReportItems parameter which is an array of folder items. The number of items in this array should be equal to the number of items in the ReportOptions array.

Usage Tips

Examples

The example below creates a trade area based on a standard level of geography. This particular example specifies San Francisco County using its five-digit Federal Information Processing Standard (FIPS) county code. The output result is an in-memory (stateless) trade area feature class as well as an image file.

NOTE 1: Output image will not be permanently saved to the repository. It will only persist for a short amount of time before being automatically deleted.

NOTE 2: The signature of the BAServerHelper.StandardLevelsOfGeography method is made compatible with the previous version of this method—the OutputReportItems parameter is specified with the params keyword allowing users to pass output report items in the variable-length list of parameters.

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.
 
// The San Francisco County study area is selected as the boundary.
StandardLevelsOfGeographyParameters parameters = new StandardLevelsOfGeographyParameters();
 
// Set specific analysis parameters
parameters.GeographyIDs = new string[] { "06075" }; // FIPS ID code for San Francisco County
parameters.GeographyLevelID = "US.Counties";
 
// Set other parameters
// In addition to creating the trade area feature layer, create an image file of
// the output result by specifying the RenderingParameters
ImageDisplay imageDisplay = new ImageDisplay();
imageDisplay.ImageDPI = 96;
imageDisplay.ImageHeight = 480;
imageDisplay.ImageWidth = 600;
 
ImageType imageType = new ImageType();
imageType.ImageFormat = esriImageFormat.esriImageJPG;
imageType.ImageReturnType = esriImageReturnType.esriImageReturnURL;
 
ImageDescription imageDescription = new ImageDescription();
imageDescription.ImageDisplay = imageDisplay;
imageDescription.ImageType = imageType;
 
RenderingParameters imageOptions = new RenderingParameters();
imageOptions.ImageDescription = imageDescription;
 
imageOptions.MapDescription = baServerHelper.GetDefaultMapDescription();
imageOptions.ZoomToLayer = true;
 
TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass, TaskOutputType.GetMapImage };
esriFolderItem outputLayer = null;
esriFolderItem outputReport = null;
 
TaskResultOutput result =
    baServerHelper.StandardLevelsOfGeography(parameters, imageOptions, outputOptions, outputLayer, outputReport);
 
string imageURL = result.MapImage.ImageURL;

See Also