Simplify feature geometry for a shapefile


PurposeThis 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.

How to use

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 with valid data for the following two input parameters: the full path to the input shapefile and the full path to the output shapefile.
  2. A new, simplified shapefile will be created.

SimplifyShapefile.h Header file
SimplifyShapefile.cpp Implementation file
LicenseUtilities.h License header file
LicenseUtilities.cpp License implementation file
PathUtilities.h Path parsing Header file
PathUtilities.cpp Path parsing Implementation file
Makefile.Windows Windows Makefile
Makefile.Solaris Solaris Makefile
Makefile.Linux Linux Makefile
Download the CPP files

Download the files for all languages




Additional Requirements
  • a non-point shapefile

Development licensing Deployment licensing
Engine Developer Kit Engine