Available with Spatial Analyst license.
Summary
Identifies the best regions, or groups of contiguous cells, from an input utility (suitability) raster that satisfy a specified evaluation criterion and that meet identified shape, size, number, and interregion distance constraints.
This tool uses a parameterized region-growing (PRG) algorithm to grow candidate regions from seed cells by adding neighboring cells to the region that best preserves the specified shape but also maximizes utility for the region. Using a selection algorithm and an evaluation criterion—such as the highest average value—the best region or regions are selected from the candidate regions that meet identified size and spatial constraints. An example of a spatial constraint would be maintaining a certain minimum distance between regions.
Usage
The input utility raster is often the output from a suitability model. A suitability model identifies how suitable each location is based on the desired attributes actually found at the location. Suitability modeling is one of the most common applications for Spatial Analyst. For additional information on suitability modeling, see Understanding overlay analysis.
The higher the input values in the utility raster, the greater the utility.
The settings for Minimum distance between regions and Maximum distance between regions take precedent over Total area. For example, if five regions are desired, but due to the specified minimum and maximum distances only four regions can be located, then only four regions will be selected. As a result, the Total area will not be met. When possible, a warning will be issued, but this is not the case for all situations.
The parameterized region-growing (PRG) algorithm grows based on utility values within the input raster—the higher value cells are more preferred in the growth. The Evaluation method determines which of the candidate regions are selected; it has no influence on the region growth.
The Locate Regions tool is very computationally intensive. There are steps you can take with how you set up your input data and the settings of certain parameters to influence this.
To speed up processing, locations that should not be considered in the selection processing should be set to NoData as a preprocessing step or eliminated using the Mask. No regions will grow from these excluded locations or be allocated in the selection process. Unlike Input raster or feature of existing regions, excluded areas have no effect on the Minimum distance between regions and Maximum distance between regions in the parameterized region-growing (PRG) algorithm or in the selection of the candidate regions.
The options that are selected for the Number of seeds to grow from and Resolution of the growth parameters can greatly affect the processing time.
Selecting the SMALL and LOW options for these parameters, respectively, will provide the best performance. Selecting SMALL, MEDIUM, or LARGE for Number of seeds to grow from and LOW, MEDIUM, or HIGH for Resolution of the growth produces the most reliable results within a reasonable amount of time.
If the Number of seeds to grow from or the Resolution of the growth are specified to any option other than MAXIMUM, data will be lost due to not growing regions from every cell and resampling to a coarser resolution. However, depending on the size of the input raster, the MAXIMUM option may be very slow; therefore, the other options may be more practical.
Depending on the size of the input raster, selecting MAXIMUM for Number of seeds to grow from or Resolution of the growth can take a long time. The Locate Regions algorithm implements a two-step process. It first grows candidate regions and it then selects the best regions from the candidate regions. The growing of the regions for large input rasters can take a long time. However, in the selecting regions step, a distance matrix is first loaded. If the matrix cannot be loaded due to memory limitations, the tool will end processing. If this occurs, either select a smaller number of seeds to grow from or specify a coarser resolution of growth.
The default values for Number of seeds to grow from and Resolution of the growth are dependent on the number of cells in the input raster. The more cells in the input raster, the longer this tool takes to execute. To avoid extremely long execution times, these default values are set accordingly.
Number of input cells
Number of seeds to grow from Resolution of the growth <= 100,000
MAXIMUM MAXIMUM 100,000 - 500,000
SMALL MAXIMUM > 500,000
SMALL LOW When the Number of regions is greater than eight, it is recommended to use the SEQUENTIAL option for the Region selection method parameter. Using the COMBINATORIAL method with more than eight regions selected may result in slow performance.
Usually, the Number of seeds to grow from value has the greatest impact on the processing speed. The higher the number of seeds to grow from, the longer the tool takes to operate. However, in most cases the results are similar, regardless of the value specified.
The Number of seeds to grow from are distributed within the input raster based on utility values—areas with higher utility values receive more seeds. The Evaluation method has no influence on their distribution.
The Resolution of the growth sets the resolution on which the parameterized region growing will occur. The input raster is resampled to the defined resolution using the bilinear resampling method. Once the regions are selected, before the final output raster is created, the results are resampled to the environment Cell Size using the nearest neighbor resampling method.
A shape adjustment is implemented for the regions at the edge of the input raster. If at least one cell should fall outside the input raster's boundary in order to maintain the shape, the utility of the region will be reduced by 50 percent. Because of this utility reduction, the region is less likely to be selected, but the reduction does not eliminate the region from the selection process.
The area selected can be more than the specified total area if Islands not allowed in regions is checked. To determine if the discrepancy between the selected area and the specified total area is based on the no-island parameter, rerun the tool with this parameter unchecked. Add the number of cells from COUNT in the output raster attribute table from the original run; then rerun the tool, multiply the sum of each by the area of a cell, and compare the results to the specified area.
If the Resolution of the growth is specified with any option other than MAXIMUM, through a postprocess, the original utility values for each region can be identified using Zonal Statistics. Enter the output region raster from Locate Regions as the zone raster and the input utility raster as the value raster.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
Syntax
LocateRegions(in_raster, {total_area}, {area_units}, {number_of_regions}, {region_shape}, {region_orientation}, {shape_tradeoff}, {evaluation_method}, {minimum_area}, {maximum_area}, {minimum_distance}, {maximum_distance}, {distance_units}, {in_existing_regions}, {number_of_neighbors}, {no_islands}, {region_seeds}, {region_resolution}, {selection_method})
Parameter | Explanation | Data Type |
in_raster | The input utility raster from which the regions will be derived. The higher the value in the input raster, the greater the utility. The raster can be of either integer or floating-point type. | Raster Layer |
total_area (Optional) | The total amount of area for all regions. The default is 10 percent of the input cells within the processing extent. | Double |
area_units (Optional) | Defines the area units used for the total_area, minimum_area, and maximum_area parameters. The available options and their corresponding units are the following:
The default is based on the input raster dataset. If the input raster is in feet, yards, miles, or any other imperial unit, SQUARE_MILES will be used. If the input raster is in meters, kilometers, or any other metric unit, SQUARE_KILOMETERS will be used. | String |
number_of_regions (Optional) | Determines how many regions the total_area will be distributed across. The maximum number of regions that can be specified is 30. The default is 1. | Long |
region_shape (Optional) | Defines the shape characteristics for the output regions. The regions start out from seed cell locations and grow outward with preference given to the cells that maintain the desired shape. The available shape options are the following:
| String |
region_orientation (Optional) | Defines the orientation of the defined shape. Regions are grown out from the seed locations with preference given to the cells that maintain the desired orientation of the region shapes. The orientation values are in compass degrees ranging from 0 to 360, increasing clockwise starting from north. The default is 0. The default of 0 orients the shapes in the following manner: Circle—no effect; Ellipse—the minor axis is orientated north-south; Triangle and Pentagon—one point is straight up; Square, Hexagon, and Octagon—one flat side is oriented east-west. | Double |
shape_tradeoff (Optional) | Identifies the weight for the cells when growing the candidate regions in the parameterized region-growing algorithm. The weighting is a tradeoff between a cell's contribution for maintaining the region shape relative to the utility contribution of the cell's attribute value. Higher values indicates maintaining the shape of the region is more important than selecting higher utility values. The acceptable percent values are 0 to 100, inclusively. The default is 50. This parameter is used to identify the feasible candidate regions. The candidate regions that will be selected are controlled by the evaluation_method parameter. | Double |
evaluation_method (Optional) | The evaluation criteria to be used for determining which of the candidate regions identified in the parameterized region-growing algorithm are most preferred. The preference can be specified based on a particular statistic of the utility values, or spatial arrangement of the cells within the regions. The available options are the following:
| String |
minimum_area (Optional) | Define the minimum area allowed for each region. The units specified by area_units will be used. To learn more about how regions are created when the minimum and maximum areas are defined, see How regions are determined when a minimum and maximum area are specified. | Double |
maximum_area (Optional) | Define the maximum area allowed for each region. The units specified by area_units will be used. To learn more about how regions are created when the minimum and maximum areas are defined, see How regions are determined when a minimum and maximum area are specified. | Double |
minimum_distance (Optional) | Define the minimum distance allowed between regions. No two regions can be within this distance. This parameter influences the parameterized region-growing (PRG) algorithm. If a cell has the potential of being added to a candidate region, but it is within this distance from any individual region in the in_existing_regions, it will not be considered for the candidate region. The minimum distance setting is not applied to excluded locations (NoData cells). The units specified by distance_units will be used. | Double |
maximum_distance (Optional) | Define the maximum distance allowed between regions. No region can be farther apart than this distance from at least one other region. When sequentially selecting regions, if the next best region is farther than this distance from any of the already selected regions, it will not be considered at this time, but it may be selected later when more regions are selected. The maximum distance is applied to in_existing_regions; that is, at least one of the selected regions must be within the maximum distance from existing regions. The maximum distance setting is not applied to excluded areas (NoData cells), and has no effect on the PRG algorithm. The units specified by distance_units will be used. | Double |
distance_units (Optional) | Defines the distance units that will be used for the minimum_distance and maximum_distance parameters. The available options and their corresponding units are the following:
The default is based on the input raster dataset. If the input raster is in feet, yards, miles, or any other imperial unit, MILES will be used. If the input raster is in meters, kilometers, or any other metric unit, KILOMETERS will be used. | String |
in_existing_regions (Optional) | A dataset identifying where regions already exist. The input can be a raster or feature dataset. If the input is a raster, any location in the raster with a valid value is considered already allocated. All other locations are set to NoData. In the parameterized region-growing algorithm, no region will grow from any location containing an existing region. Existing regions will be used in the growth and evaluation of the minimum_distance and maximum_distance as described in the corresponding parameter descriptions above. | Raster Layer; Feature Layer |
number_of_neighbors (Optional) | Defines which neighboring cells to use in the growth of the regions. The available options are the following:
| String |
no_islands (Optional) | Defines if islands will be allowed within the potential regions.
| Boolean |
region_seeds (Optional) | Defines the number of seeds from which to grow the potential regions. To learn more about how the seeds influence the region growth algorithm, see How seeds are distributed. The available options are the following:
| String |
region_resolution (Optional) | Sets the resolution at which region growth occurs. The input raster will be resampled to the resolution determined by the number of cells identified by this parameter (see below). For example, for Low the input raster is resampled to 147,356 cells. The parameterized region-growing algorithm grows on the resampled intermediate raster. Once the regions are selected from the resampled intermediate raster, the selected regions will be resampled to the Cell Size. An adjustment to the target resolutions identified below may be implemented if the number of cells in the desired average region size is too small or too large. This adjustment makes sure there will be enough cells in each desired region or that unnecessary processing will not occur. As a result, the total cells for the intermediate resampled raster for each of the specified resolutions below can be lower or higher than the target number of cells. For more information on this adjustment and the thresholds used, see Adjusting the region growth resolution based on the size of the desired regions. If the input has less than 147,356 cells or MAXIMUM is selected, no resampling will occur and the region growth will process on all cells in the input raster. If the input raster has less than 147,356 cells, the LOW, MEDIUM, or HIGH options have no effect. The available options are the following:
| String |
selection_method (Optional) | Identifies how the regions will be selected. The available options are the following:
| String |
Return Value
Name | Explanation | Data Type |
out_raster | The output regions raster. Each region is uniquely numbered with values greater than zero. Cells that do not belong to any regions will be assigned zero. The output is always an integer raster. Additional fields are calculated for each region storing statistics of the selected regions. These fields are the following:
| Raster |
Code sample
LocateRegions example 1 (Python window)
The following Python window script demonstrates how to use the LocateRegions tool.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outRegions = LocateRegions("suitsurface", 13.5, "SQUARE_MILES", 5, "CIRCLE",
0, 50, "HIGHEST_AVERAGE_VALUE", 2, 5, 1, 3, "MILES",
"existingreg.shp", "EIGHT", "NO_ISLANDS", "SMALL",
"LOW", "COMBINATORIAL")
outRegions.save("C:/sapyexamples/output/outregions")
LocateRegions example 2 (stand-alone script)
Identifies the optimum eight regions from a suitability surface while meeting the spatial requirements.
# Name: LocateRegions_Ex_02.py
# Description: Selects the best specified number of regions
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
InRaster1 = "suitsurface"
InTotalArea2 = 13.5
InAreaUnits3 = "SQUARE_MILES"
InNumberofRegions4 = 5
InRegionShape5 = "CIRCLE"
InRegionOrientation6 = 0
InShapeTradeoff7 = 50
InEvaluationMethod8 = "HIGHEST_AVERAGE_VALUE"
InMinimumArea9 = 2
InMaximumArea10 = 5
InMinimumDistance11 = 1
InMaximumDistance12 = 3
InDistanceUnits13 = "MILES"
InExistingRegions14 = "existingreg.shp"
InRegionofNeighbors15 = "EIGHT"
InRegionNoIslands16 = "NO_ISLANDS"
InRegionSeeds17 = "SMALL"
InRegionResolution18 = "LOW"
InCombinatorialThreshold19 = "COMBINATORIAL"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute Locate Regions
outRegions = LocateRegions(InRaster1, InTotalArea2, InAreaUnits3, InNumberofRegions4,
InRegionShape5, InRegionOrientation6, InShapeTradeoff7,
InEvaluationMethod8, InMinimumArea9, InMaximumArea10,
InMinimumDistance11, InMaximumDistance12, InDistanceUnits13,
InExistingRegions14, InRegionofNeighbors15, InRegionNoIslands16,
InRegionSeeds17, InRegionResolution18, InCombinatorialThreshold19)
# Save the output
outRegions.save("C:/sapyexamples/output/outregions")
Environments
Licensing information
- Basic: Requires Spatial Analyst
- Standard: Requires Spatial Analyst
- Advanced: Requires Spatial Analyst