FRAMES | NO FRAMES
RemoveOverlap Method

Removes overlap (cannibalization) between trade areas.

Availability: Business Analyst Server.

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

Parameter Description
Parameters Configuration options for analysis. Type RemoveOverlapParameters.
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. If the input Boundaries layer has no overlapping areas, an exception will be thrown.

Remarks

The RemoveOverlap method removes cannibalization between trade areas generated in the Business Analyst Server or custom derived trade areas. Overlap is removed using Thiessen polygons or the grid-based approach to find the midline between the intersecting areas.

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.

How Does it Work

Assume you have two intersecting trade area polygons.

In the example below, the highlighted light blue area represents the overlap area. The two triangle symbols represent the stores for each trade area.

The RemoveOverlap method in the Business Analyst Server is based on the assumption that the overlap is only removed by dividing the intersecting area. The method does not assign areas that are not overlapped to other stores. In the example above, only the area that is shaded blue will be affected by the RemoveOverlap function.

There are two approaches for removing overlap:

Method 1—Thiessen Polygon

The Thiessen polygon approach removes overlap between two or more trade areas using straight lines to divide the area of overlap. This approach uses a series of geometric functions to create nonoverlapping trade areas. First, a line is drawn between each store and a neighboring store.

Second, a perpendicular line is drawn bisecting the line drawn between the stores at a right angle. The dotted line below is drawn at the midpoint between the two store locations and represents the division between the two trade areas.

Method 2—Grid

The grid approach takes into account weights of the stores and the shape of the overlapping polygon to make the division more natural.

The grid approach uses a series of geometric functions to create nonoverlapping trade areas. First, a line is drawn between each store and a neighboring store. Second, two parallel lines are drawn that pass through the stores perpendicular to the line drawn between the stores. The red shaded area below illustrates the target area of intersection. This area is determined by finding the area of overlap between the two trade areas contained between the two perpendicular lines.

After determining the area of intersection, a grid is created by drawing parallel lines between the two stores. A simplified example is illustrated below.

Intersection points are then determined within the red area so each grid line can be divided into nonoverlapping trade areas. The yellow points above illustrate how the midpoints are determined. These points are connected to represent the division between the overlapping trade areas.

In the grid approach, there are three different methods for determining where to draw the intersection line. These three methods determine how the midpoints are set to draw a line between the two polygons to remove the overlap. Specifically, these three methods determine where the yellow dots are placed.

Use weight field

The weight method uses a numeric weight field you specify to determine the location of the midpoints. For example, you could use the ratio of the size of each store (gross leasable area or square footage) to determine where to draw the area of overlap. If the green store is larger than the red store, the yellow dots will move to the right and the resulting green trade area will be larger.

Use area of trade area as weights

If you do not have numeric attribute data to determine the weights, you can use the area of the trade areas to determine the location of the midpoints. This method assumes that larger trade areas will have more influence in a particular market. For example, the green store's trade area is larger, and the yellow dots will move to the right.

Use the actual midpoint of the intersecting grid line

In this method, the midpoints are placed so the grid lines are divided equally in the red shaded area. The geometric midpoint is determined by measuring the length of each parallel grid line and dividing each line equally between the stores.

Usage Tips

Examples

The example below generates non-overlapping trade areas derived from overlapping trade areas. The original ring-based trade area layer and the trade area layer after executing the RemoveOverlap method are stored in the repository.

NOTE: The signature of the BAServerHelper.RemoveOverlap 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
 
RenderingParameters imageOptions;
TaskOutputType[] outputOptions;
esriFolderItem outputLayer;
esriFolderItem outputReport;
 
// ========= STEP 1: Create a boundary layer with simple rings around 3 stores
 
PointRecord[] storePoints = new PointRecord[3];
 
storePoints[0] = new PointRecord();
storePoints[0].Name = "lj_store";
storePoints[0].Description = "La Jolla Store";
storePoints[0].StoreID = "1";
storePoints[0].Latitude = 32.869087;
storePoints[0].Longitude = -117.246866;
 
storePoints[1] = new PointRecord();
storePoints[1].Name = "ob_store";
storePoints[1].Description = "Ocean Beach Store";
storePoints[1].StoreID = "2";
storePoints[1].Latitude = 32.746841;
storePoints[1].Longitude = -117.238426;
 
storePoints[2] = new PointRecord();
storePoints[2].Name = "pb_store";
storePoints[2].Description = "Pacific Beach Store";
storePoints[2].StoreID = "3";
storePoints[2].Latitude = 32.800998;
storePoints[2].Longitude = -117.235344;
 
// Create a store feature layer based on an array of point records.
PointLayer storeLayer = new PointLayer();
storeLayer.Points = storePoints;
 
SimpleRingsParameters simpleRingsParameters = new SimpleRingsParameters();
 
// Set specific analysis parameters
simpleRingsParameters.DistanceUnits = esriUnits.esriMiles;
simpleRingsParameters.Radii = new double[] { 3, 4, 5 };
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 };
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.esriFolderTradeAreas;
outputLayer.itemName = "simpleRings_before_RemoveOverlap";
outputLayer.projectName = "Default Project";
outputLayer.workspaceName = "Default Workspace";
 
TaskResultOutput simpleRingsResult =
    baServerHelper.SimpleRings(simpleRingsParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer boundaryLayer = new DataLayer();
boundaryLayer.RecordSet = simpleRingsResult.RecordSet;
 
// ========= STEP 2: Execute the analysis
 
RemoveOverlapParameters parameters = new RemoveOverlapParameters();
 
// Set specific analysis parameters
parameters.AreaLinkField = "STORE_ID";
parameters.Boundaries = boundaryLayer;
parameters.CenterMethod = esriOverlapRemoverCenterMethod.esriOverlapRemoverCenterMethodUseStoreLayer;
parameters.OverlapMethod = esriOverlapRemoverOverlapMethod.esriOverlapRemoverOverlapMethodThiessen;
parameters.Stores = storeLayer;
 
// StoreIDField is useless for stores specified with array of PointRecord
//parameters.StoreIDField = "STORE_ID";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { 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.esriFolderTradeAreas;
outputLayer.itemName = "simpleRings_after_RemoveOverlap";
outputLayer.projectName = "Default Project";
outputLayer.workspaceName = "Default Workspace";
 
TaskResultOutput result =
    baServerHelper.RemoveOverlap(parameters, imageOptions, outputOptions, outputLayer, outputReport);

See Also