Generalization Tool


The purpose of the Generalization toolbar is to expose some of generalization, or morphological methods available through Spatial Analyst Objects and demonstrate how to develop a complex application using Spatial Analyst objects. This dll provides interfaces for removing noise, smoothing a surface, majority filtering, smoothing edges, grouping regions, nibbling unwanted zones, expanding zones, shrinking zones, and thinning zones.

This Generalization toolbar application does not support selection, or changing the output spatial reference.

How to use:
  1. Register DLL: Click Tool/Customize, click Add from file button in the Customize dialog, navigate to the file esriSAGeneralize.dll, and click OK button. Click Toolbars tab in Customize dialog, check Generalization, then the Generalization toolbar appears.
  2. Using VB Project: To use VB project, make three folders: class, form, module. Copy all class file (*.cls) into folder class, copy all form files into folder form, copy resource file generalize.res and module file utilmodule.bas into folder module, leave the VB project file in the same level as the three folders.
  3. The working directory for the Generalization toolbar is implemented through the Spatial Analyst toobar. To set up the working directory (including other environment settings except the output spatial reference), use the Options dialog in Spatial Analyst toolbar, and type the path into the working directory text box.
  4. The results are temporary rasters by default, unless an output name is specifically given. To save the results, use Make Permanent in the Context Menu.


Requires: Spatial Analyst Extension License

Difficulty: Advanced

Visual Basic
File Description
SAGeneralizeCommandExpand.cls The class module performing expanding operation.
SAGeneralizeCommandGroupRegions.cls The class module for region grouping.
SAGeneralizeCommandMajorityFilter.cls The class module performing majority filtering.
SAGeneralizeCommandNibble.cls The class module for Nibble operation.
SAGeneralizeCommandRemoveNoise.cls The class module for removing noise.
SAGeneralizeCommandShrink.cls The class module performing shrink operation.
SAGeneralizeCommandSmoothEdges.cls The class module for smoothing edges.
SAGeneralizeCommandSmoothRaster.cls The class module for smoothing raster.
SAGeneralizeCommandThin.cls The class module performing thining operation.
SAGeneralizeMenu.cls The class module defining the menu.
SAGeneralizeToolbar.cls The class moduledefining the toolbar.
frmExpand.frm The form performing expand operation.
frmGroupRegions.frm The form for region grouping.
frmMajorityFilter.frm The form performing majority filtering operation.
frmNibble.frm The form performing nibbling operation.
frmRemoveNoise.frm The form perform removing noise operation .
frmShrink.frm The form for performing shinking operation.
frmSmoothEdges.frm The form for smoothing edges.
frmSmoothRaster.frm The form for smoothing raster.
frmThin.frm The form for performing thining operation.
Utilmodule.bas Utility functions used in this sample.
generalize.RES The resource file that stores icons.

Key CoClasses: RasterGeneralizeOp, RasterNeighborhoodOp, RasterNeighborhood, RasterConditionalOp, RasterMathOps, RasterMakerOp, RasterReclassOp, RasterAnalysis
Key Interfaces: IGeneralizeOp, INeighborhoodOp, IRasterNeighborhood, IConditionalOp, ILogicalOp, IRasterMakerOp, IReclassOp, IRasterAnalysisEnvironment
Key Members: IGeneralizeOp::Thin, IGeneralizeOp::BoundaryClean, IGeneralizeOp::Shrink, IGeneralizeOp::Nibble, IGeneralizeOp::MajorityFilter, IGeneralizeOp::Expand, IGeneralizeOp::RegionGroup, INeighborhoodOp::FocalStatistics, IRasterNeighborhood::SetDefault, IConditionalOp::SetNull, ILogicalOp::LessThan, ILogicalOp::EqualTo, IRasterMakerOp::MakeConstant, IReclassOp::Lookup