logo_web1.jpg (5049 bytes)
HOME ET Solution Center index HOME
Smooth/Generalize Features with ET GeoWizards

Contents:

The purpose:

The purpose of this document is to discuss the processes of simplification (generalization) and smoothing features in ArcGIS (ArcView license). While the generalization and smoothing of polylines is comparatively simple process, when applied to polygons there are certain complications connected to the topological relationships between the adjacent polygons. 

ET GeoWizards functions available

ArcGIS has standard Generalize and Smooth functions, but they are available only for users with ArcEditor or ArcInfo licenses

ET GeoWizards offers the following tools to ArcGIS users with any license :

  • Generalize - Generalizes ( reduces the number of vertices required to represent a polyline ) the features of a polyline dataset using the Douglas-Poiker algorithm

  • Densify - Densifies ( adds vertices to  polyline at a user-specified tolerance ) the features of a polyline dataset.

  • Smooth - Smoothes  the features of a polyline dataset using three different smoothing algorithms

    • Bezier curve

    • B - Spline

    • T - Spline (Tension Spline)

Note that all the functions above are available only for polylines. In this document we'll describe a procedure that will make use of these tools to Generalize/Smooth polygons.

All the links in this document are to the functions available via the interface of ET GeoWizards. If the procedure is to be performed in the Model Builder - refer to the corresponding tools available in the ET GeoWizards ToolBox. If performed via a VBA script - refer to ET GeoWizards Scripting

Definitions:

  • Generalization - the process of removing some vertices from a polyline or polygon boundary without destroying its essential shape.

  • Smoothing - the process of introducing new vertices in a polyline or polygon boundary in order to achieve shapes with no sharp corners.

The importance: 

In many cases the data that we receive is over sampled. Nowadays  a big part of the GIS data is captured via GPS devices that get locations automatically every few seconds. In this fashion a straight line sometimes is described by many vertices when actually only two vertices are needed. This not only increases the size of the data, but makes certain geoprocessing operations on the data to need extra  computer memory to complete. Note that the memory needed is dependant not only on the number of features, but also on the complexity of these features, measured in the total number of vertices.

Over sampled polygons

Polygons represented with the significant vertices only

Smoothing/Generalizing polygons. Why it is so difficult?

In the Shapefiles and GeoDatabases (not in the coverages) each polygon has its own outline. This means that the common boundary between two adjacent polygons is represented by two coincident polylines. If we smooth/generalize these adjacent  polygons each of the outlines will be smoothed/generalized  separately and DIFFERENTLY. As a result we will get gaps and/or overlaps on the boundary. With other words we will end up with destroyed topology.
Further in this document all the examples and explanations will be based on the Smoothing, because the effect is more pronounced, but everything is applicable for the generalization process as well.

Original Polygons Polygons Smoothed directly

The example above visualizes the gaps resulting from Smoothing the polygons directly.

So, how to smooth polygons?

Lets think a bit in the good old Coverage way, where all the geometries were stored as arcs and the polygons were build from these arcs (no duplicate geometry on the boundary of two adjacent polygons). If something was changed in the geometry of the Arcs it reflected in the polygons built from them. If we smooth/generalize an Arc, the two polygons in which this Arc participates will be smoothed/generalized EQUALLY.

Here is the ArcGIS procedure that emulates this behavior. All the functions are available in ET GeoWizards.

  • Convert the polygons to polylines (this just creates a polyline shapefile from the polygon boundaries). Polygon To Polyline function

  • Clean the polylines (this will create all intersections and remove the duplicate polylines on the boundaries between two adjacent polygons). Clean Polyline function

  • Smooth the polylines (there is no duplicate polylines, so no topological problems will be introduced). Smooth Polyline function

  • Build new polygons from smoothed polylines (this will give us smoothed  topologically correct polygons). Build Polygons function

1. Polygon To Polyline 2. Clean Polylines
3. Smooth Polylines (B-Spline method used) 4. Build Polygons

How to restrict the Smoothing and remove the unnecessary vertices after smoothing?

The degree of smoothing can be controlled by the parameters used in the Smooth function. In some cases however due to the lack of enough vertices the parameters used can not restrict the smoothing too much. In such cases, we can introduce new vertices to the cleaned polylines (Densify function) before proceeding with smoothing. After smoothing we can remove the unnecessary vertices before building the polygons. 

Polygons smoothed with the procedure above The degree of smoothing to high
Original vertices Vertices after Densify
Smoothed densified polylines Resulting smoothed polygons

The procedure gets just a bit more complex

  • Convert the polygons to polylines (this just creates a polyline shapefile from the polygon boundaries). Polygon To Polyline function

  • Clean the polylines (this will create all intersections and remove the duplicate polylines on the boundaries between two adjacent polygons). Clean Polyline function

  • Insert new vertices - Densify Polylines function

  • Smooth the polylines (there is no duplicate polylines, so no topological problems will be introduced). Smooth Polyline function

  • Remove the excess vertices - Generalize Polylines function

  • Build new polygons from smoothed polylines (this will give us smoothed  topologically correct polygons). Build Polygons function

What about the attributes?

A reasonable question. In the process of converting the polygons to polylines and cleaning the polylines we've lost the polygon attributes. We can rectify this by adding a three simple steps to the procedure:

  • Get the label points of the smoothed polygons - Polygon To Point function with the Label Point option
  • Get the attributes of the original polygons to the label points created above - The standard ArcGIS Spatial Join function (Polygons to Points). If used in the Model Builder - the Spatial Join tool of ET GeoWizards
  • Get the attributes from the label points to the smoothed polygons - The standard ArcGIS Spatial Join function (Points To Polygons). If used in the Model Builder - the Spatial Join tool of ET GeoWizards

This is getting too complex....

ET GeoWizards  offers three ways of achieving the above procedure

  • Via the User Interface - just perform the steps one by one using the Wizards available
  • With a simple VBA script - many of the functions of ET GeoWizards are available for use within VBA scripts or custom applications written in any COM language. See an example with working code here
  • Create a Geoprocessing Model in the Model Builder (ArcGIS 9.0 and above only) using the ET GeoWizards geoprocessing tools made available in version 9.2. A model performing the task is included in the download of ET GeoWizards  for ArcGIS 9.x

A diagram of the process:

See ET GeoWizards User Guide for more information

For any comments and enquiries contact: webmaster@ian-ko.com
Esri and all Esri products mentioned are trademarks of Environmental Systems Research Institute, Inc.
Copyright: Ianko Tchoukanski