NAME: Grid Tools (Jenness Enterprises), v. 1.1
Last modified: January 27, 2004
TOPICS: statistics, neighborhood, legend, clip, merge, mosaic, combine, ramp, rainbow, color, GTheme
Recommended Citation Format: For those who wish to cite this extension, the author recommends something similar to:
Jenness, J. 2004. Grid Tools (Jenness Enterprises) v. 1.1 (grid_tools_jen.avx) extension for ArcView 3.x. Jenness Enterprises. Available at: http://www.jennessent.com/arcview/grid_tools.htm.
Please let me know if you cite this extension in a publication (email@example.com). I will update the citation list to include any publications that I am told about.
1) Begin by placing the "grid_tools_jen.avx" file into the ArcView extensions directory (../../Av_gis30/Arcview/ext32/).
2) After starting ArcView, load the extension by clicking on File --> Extensions… , scrolling down through the list of available extensions, and then clicking on the checkbox next to the extension called "Grid Tools (Jenness Enterprises)"
3) All tools are found in the “Grid Tools” menu in the View Menu Bar.
This option generates a new grid representing neighborhood statistics from an existing grid. Each cell value in the new grid represents some statistic (i.e. mean, min, max, standard deviation, etc.) from some region of cells surrounding the original cell in the original grid, where the region is called a Neighborhood and can come in a variety of shapes and sizes. The standard Spatial Analyst Neighborhood Statistics function includes options for rectangles, circles, wedges and doughnuts (see ArcView Help files for more information; especially “FocalStats Discussion”). The Neighborhood Statistics function included with this extension is very similar to the original Spatial Analyst function except that this tool allows you to generate custom-shaped neighborhoods and also generate multiple sets of statistics with one operation.
Click the “Neighborhood Statistics” menu item to start the process. You will be asked to identify the grid theme you wish to analyze and the statistics you wish to generate. You may select multiple statistics. This window is resizable by dragging on a corner.
If your Grid Theme is a Floating Point theme (i.e. with decimal numbers, and therefore without an attribute table), then your statistics options will include:
If your Grid Theme is an Integer theme, you have a few more options:
You will next be asked to define your neighborhood. You can choose between a circle, annulus (doughnut-shape), rectangle, wedge, or custom shape. You can also enter your neighborhood parameters in units of either grid cells or map units (i.e. meters, feet, etc.).
Next click the “Create Custom Neighborhood” button to open the custom neighborhood definition window. Select your general neighborhood size by moving the slider to the correct value, and then click in the boxes to specify which cells you wish to be included in the analysis:
Click OK to go back to the “Define Neighborhood” window and notice that it now says “Custom 7 x 7 Neighborhood Loaded…”.
You can now click ‘OK’ and generate your neighborhood statistics grid(s).
This function produces a report detailing some general statistics for grid themes, including the minimum, maximum, mean, standard deviation, variance and range for all grid cell values in the grid. The report also describes the geographic extent, the number of rows, columns and cells, and the hard drive location of the grid.
Select the “Grid Descriptive Statistics” menu item and then select the grids you would like to describe:
Click ‘OK’ and you will see a report window with the grid description:
In this case, to standardize a grid means to transform the grid cell values such that the grid has a mean = 0 and a standard deviation = 1. This may be useful in some analyses where the grids may have widely different numeric scales. For example, Andrew Weiss, in a discussion of Topographic Position Indices, describes how it may be desirable to standardize TPI grids before using them for landform identification. This process is described in a poster presented at the 2001 ESRI User Conference.
Technically, all that happens in this operation is that the original grid is subtracted from the grid mean, then divided by grid standard deviation:
This extension offers two tools to generate customized color ramps for grid legends, enabling you to ramp between multiple colors and generate a large number of color levels. The tools also produce graphic color bars which can be used as attractive legends in layouts or other software.
This tool generates an array of colors which replicate the visible color spectrum. Click the “Apply Rainbow Color Ramp…” menu item to open the Rainbow Color Ramp Options window:
Select your grid theme and the number of color gradations. This number will reflect the number of classification levels, or individual colors, in your new legend.
You have the option to ramp from Red to Violet or from Violet to Red. In either case the colors will ramp through the visible spectrum:
Click ‘OK’ to generate your new legend:
You also have the option to set your new legend visible or not. In cases where you generate large numbers of classification levels (150 in the example above), it may be useful to set your legend invisible so that it doesn’t take up the entire View table of contents area. You can also set the legend visibility in the “Theme” menu, but setting the visibility directly with this tool may be more convenient.
Finally, you can generate a graphic rainbow color ramp bar by clicking the “Make Graphic Color Bar” button. This option generates a new view, labeled something like “Color Bar” (possibly with a number after it) and will contain a single graphic object:
This graphic can be resized by selecting it with the button and stretching it by dragging on one of the handles:
This color bar can then be added to a layout using the standard Layout functions. Remember that this color bar is actually a View document, so you add it to your layout as you would any other view. Alternatively, you could copy and paste this graphic directly into your view. If so, you will almost certainly need to reposition and resize the graphic. The original graphic coordinates extend from (0, 0) to (500, 20).
You can also take a screenshot of the color bar to paste it into graphic-editing software (i.e. Photoshop, Photopaint, etc.). Click [Alt]-Print Screen to copy the image to the clipboard, then [Control]-V to paste the image into your graphics software.
This tool is intended to generate grid legends that ramp (or blend) between multiple colors, and to give you the ability to set the colors and ramp anchor points. IMPORTANT: This tool is not designed to do any type of classification analysis. It only ramps colors smoothly between anchor points.
Click the “Build Custom Color Ramp…” menu item to start the process. You will first be asked to identify the grid theme to build a custom legend for:
Select your grid and click ‘OK’ to open the “Build Color Ramp” window:
The vertical slider on the right of the window shows how the colors will be ramped, and the number box at the top of the window shows how many total color levels to include in the ramp. The color boxes on the right side of the slider show the color anchors, and the numbers on the left side of the slider show the values associated with those colors. In this case, the tool will generate a legend with 24 shades of gray, ranging from White at Value=1617 to Black at 2348.
You can add a midpoint color anchor by dragging the slider to the appropriate point and choosing a color. For example, to ramp from White to Red to Black, you would drag the slider to the appropriate point and enter a Red color. As soon as you move the slider, the Color Palette window and a “Select Color” window will open:
Select the desired color and click ‘OK’ to add your new color anchor:
Apply, OK and Clear: You can test your new color ramp by clicking the ‘Apply’ button. This will apply the new color ramp to your theme while leaving the window open. Clicking the ‘OK’ button will apply the color ramp and close the window. The ‘Cancel’ button will close the dialog and reset the theme legend to the original condition.
Changing or Deleting Anchor Colors: You can change the colors of any of the anchor points, or delete any of the internal anchor points, by clicking on the color box. You will be prompted to either delete that color anchor or to change the color:
You cannot delete either of the end anchor points.
Clear: At any point you can clear and reset your custom ramp by clicking the ‘Clear’ button. This button clears all internal color anchors and resets the endpoints to White and Black. It does not change the current number of ramped colors.
Invert: The ‘Invert’ button reverses the order of the colors.
Refresh: The “Refresh” button redraws the slider and the color anchors. The window is resizable by dragging on a corner, but unfortunately the slider does not change size with the window. If you change the size of the window, you must click the ‘Refresh’ button to redraw everything.
This tool provides a way to save custom color ramps so they can be used with other themes. This tool does not save ArcView legends (*.avl) files like the Legend Editor does, but rather specialized files intended to be used specifically with this tool.
IMPORTANT: The saved color ramps do not reference the actual values of the data. If you build and save a custom ramp on a theme that ranges from a value of 1000 to 2000, then you will still be able to apply it to a theme that ranges from 100 to 200. The color anchor points are saved in terms of the percentage along the range of the data rather than in terms of specific data values.
The “Make Graphic Color Bar” button will generate two graphic color bars that illustrate your color ramp, and which can be used to help make more attractive legends for your grid themes. For example, this tool was used to generate color bars for the author’s Mahalanobis Distances extension manual (see two illustrations at:
In the case of the vertical color bars, the author took screen shots of the color bars, pasted them into image-editing software and rotated them (see discussion of Rainbow color bars above for instructions).
The button makes two color bars. The top one shows only the colors that are actually used in the legends (40 in the example below), while the bottom color bar smoothly blends between colors.
These color bars are actually in View documents, so they can be added to layouts using the “Add View Frame” function. The color bars can also be copied from the Color Bar window and pasted directly into your views, in which case they will likely need to be resized and repositioned in order to look aesthetically correct. They can be resized and repositioned the same way any other graphic shape is, by selecting it with the button and then moving the shape or dragging one of the handles.
This extension allows you to clip grids according to the display extent, a theme extent, selected polygons in a polygon theme, selected polygon graphics, or selected grid cell in an integer grid. The extension also allows you to clip off the regions outside the specified area or to clip out the specified area.
Click the “Clip Grids…” menu item to open the “Clip Grids” window:
Select the grid or grids you wish to clip, the region you wish to base the clip on, and whether you want the new grid to represent only the region (Inside) or everything except the region (outside).
ArcView offers several methods for combining multiple grids into a single grid:
Merge: The Merge request treats the set of multiple grids as a stack, where some grids may overlap others. In cases of overlapping grids, the grid which is highest in the stack will take precedence. For example, if a cell in Grid A has a value of 5, and a cell in the same location in Grid B has a value of 10, and if Grid A is higher in the stack than Grid B, then the Combined Grid cell value for that location will be 5. If Grid B was higher in the stack, then the new cell value would be 10.
To do a merge operation correctly, then, you must make sure your grids are in the right order. The Merge tool offered with this extension offers functions to sort your grids. Click the “Merge Grids…” menu item to open the “Select and Sort” window:
Select the grids you want to merge from the list on the right and click the “Add” button to add them to the list on the left. Then select any of the grids in the list on the left and use the arrow buttons to move them up or down. Once your list is sorted correctly, click the “OK” button to merge them.
Mosaic: The Mosaic request attempts to blend overlapping grids so that the boundary is not so sharply defined. The author recommends that you review the ArcView Help Item “Mosaic Discussion” for an explanation of what happens here.
Combine: The Combine request only works for Integer grids, and is a method of combining the attribute data. The combined grid will have a separate field in the attribute table for each of the input grids, and will have a separate record for every unique combination of attribute values.
Enjoy! Please contact the author if you have problems or find bugs.
Updates to this extension and an on-line version of this manual are available at
Please visit Jenness Enterprises ArcView Extensions site for more ArcView Extensions and other software by the author. We also offer customized ArcView-based GIS consultation services to help you meet your specific data analysis and application development needs.