Hawth's Analysis Tools for ArcGIS


 You are here: Home > Hawths Tools > Tools Descriptions & Help


Input: a thematic (categorical) raster layer
Output: a table representing maximum separation values (comma delimited text file), and optionally the points representing the pixels at which the greatest separation was found for each unique value, and optionally a set of minimum convex polygons that contain all pixels of each unique value

  • for each unique value in a thematic raster layer, this tool determines what the maximum separation between any two pixels of that value are (reported in map units e.g. meters for UTM)
  • optionally, this tool outputs a point layer that demarcates the two pixels for any given unique value for which the maximum separation distance was obtained
  • since distance alone is not a good index of separation, this tool can also generate (for each unique value) a minimum convex polygon that contain all the pixels of that value in the raster layer


  • processes only one band of the raster (the first)
  • geographic coordinate systems must not be used (planimetric distance has no meaning for geographic coordinate systems)
  • requires direct programming access to the raster
  • note that this is an experimental tool and that there are much more statistically sophisticated measures of separation, pattern and dispersion that can be calculated
  • it is strongly recommended that you read all of the information on this page before using this tool

[Click for larger view]


Figures A-E. In this example a relatively small thematic raster grid representing landcover (A) is processed to calculate the maximum separation between each of its 18 unique values. For this example, the options to produce the point layer and minimum convex polygons are switched on. The basic output is a comma delimited textfile of the maximum separation distance (B). The point layer (C) has been colour coded to better represent the pairs of points that, for each unique value, represent the two pixels that were maximally separated. The point attribute table contains a field that has the uniqe value listed so the user can easily identify each pair. The minimum convex polygons (D) are contained in a single polygon shapefile layer and there is a high degree of overlap between them. In this example, three of the polygons have been made different colours (yellow, green, red), to allow you to compare back to the original image (A). Finally, image E shows a zoomed in view of one of the values (yellow) that only occured in a small portion of the image. The MCP and two maximally separated points are shown in red.


Getting started. A thematic raster layer must be loaded into ArcMap in order to use this tool. If you wish to run this tool on a multi-band image, you must load the bands into ArcMap separately, and run the tool on each one. It is recommended that you create a new, empty folder that will contain all of the output files from this tool. [Note: when you press the folder button to identify your output folder, you need to click only once on the output folder and then press the Add button. If you double click on the output folder, the dialog box will simply open that folder, and you will not be able to press the Add button. This is an unfortunate nuance of the way this ArcObjects dialog works.]

“Automation Type Not Supported” Error This program requires direct programming access to the raster layer. The raster data must therefore use a pixel data type that is supported by Visual Basic. If you receive an Automation Error message, you will need to use the Raster Pixel Type Conversion Tool. This issue is described in detail in the article “ Accessing raster cell values programmatically: the problem of mismatched data types“.

Processing method, time and system resources. In order to run in a reasonable amount of time, this tool tends to use a fair amount of system resources. The larger the raster layer and the greater the number of unique values, the more resources it will require. This tool actually uses two different processing methods. If the minimum convex polygon (MCP) option is switched off, the program identifies all “outer” pixel locations for a given unique value, and iterates through every single pair to determine the maximum separation value. This will generally be the faster processing method. If the MCP option is switched on, the program identifies all the “outer” locations, but then generates the minimum convex polygon. The maximum separation distance is then calculated by iterating through ONLY the points that occur on the boundary of that MCP. For example, if there were 5000 “outer” pixels of one particular unique value identified, the first (non-MCP) method would iterate through 5000!/2 (i.e. 5000 factorial / 2) pairs of points. Using the MCP method, the program may only have to iterate through perhaps 50!/2 pairs (depending on the configuration of the MCP), and possibly as few as 3!/2. As there is a relatively high performance cost to calculate MCP’s it will usually be the slower method. However, in cases where the raster is large and the unique value in question is not rare, the MCP method will actually run considerably faster. Either way, it does not seem to take an unconscionably long time to run, but it is strongly recommended that you run a few tests on a subset of data before starting this program on a large dataset.

Multiple pairs of points with the same maximum separation. In instances where multiple pairs of pixels have the same maximum separation distance, the optional point output layer will ONLY include one of the pairs of points. It is not a random pair of points, it is the pair of points which is identified as the FIRST set that are maximally separated. This may only be of interest to people who wish to use the point layer for other (perhaps statistical) purposes.

Home | Articles | Services || Hawth's Tools:  Overview | Description | Download | FAQ