Simplify feature geometry for a shapefile


Purpose
This sample simplifies the geometry for each feature in a shapefile and writes the shapefile's features with their simplified geometry to a new shapefile. Simplifying geometry permanently alters the input geometry so that the geometry becomes topologically consistent.
 
For point collections, duplicate points (points with the same X and Y coordinates) are removed (unless they are attribute aware and have different attributes).
 
For segment collections, duplicate segments are removed, crossing segments are split into non-crossing segments (the crossing point becomes a vertex for the connected segments), overlapping segments are broken into non-overlapping segments (the overlap becomes a new segment), and non-connected paths are connected.
 
For polygons, overlapping rings are split into non-overlapping rings, exterior and interior rings have the proper orientation, and non-closed rings are closed.
 
It is not valid to simplify a point shapefile.

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the application. Results are written to the console.


Download the files for Java
geodatabase/SimplifyShapefileGeometry.java Main class




Additional Requirements
  • US States and Counties data (recommended)

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView