Simplify feature geometry for a shapefile


This sample simplifies the geometry for each feature in a shapefile, and writes the shapefile's features with their simplified geometry to a new shapfile. Simplifying geomnetry permanently alters the input geometry so that the geometry becomes topologically consistent.  For Point Collections, this means that all duplicate Points (Points with the same X and Y coordinates) are removed (unless they are attribute aware and have different attributes).  For Segment Collections, this means that all duplicate Segments are removed, all Crossing Segments are split into non-crossing segments (The crossing point becomes a vertex for all of the connected segments), all overlapping segments are broken into non-overlapping segments (the overlap becomes a new Segment), and all non-connected Paths are connected.  For Polygons, this means that all overlapping Rings are split into non-overlapping Rings, all Exterior and Interior Rings have the proper orientation, and all non-closed Rings are closed. It is not valid to simplify a point shapefile.
Engine: VB6

Platforms: Windows

Requires: a non-point shapefile

Minimum ArcGIS Release: 9.0

How to use:
  1. Add the bas module to your VB6 project and call the function.

Download the VB6 files
SimplifyShapefile.bas Class file containing the VB function.

Download the files for all languages

Key Libraries: Geodatabase, Geometry, DataSourcesFile, System
Key CoClasses:ShapefileWorkspaceFactory, FeatureClass, FeatureCursor, Feature
Key Interfaces: IWorkspaceFactory, IFeatureWorkspace, IFeatureClass, IFeatureCursor, IFeatureBuffer, ITopologicalOperator2
Key Members:IFeatureCursor::Insert, IFeatureBuffer::CreateFeatureBuffer, ITopologicalOperator2::Simplify, IFeatureWorkspace::CreateFeatureClass