Skip to content

GeoProcessor / Command / SimplifyGeoLayerGeometry


Overview

The SimplifyGeoLayerGeometry command decreases the number of vertices within the geometries for each feature of a GeoLayer. This command is useful when the file size of a GeoLayer is too large.

  • This command is designed to simplify GeoLayers with LINE or POLYGON geometry by removing unnecessary vertices. GeoLayers with POINT geometry cannot be simplified with this command.
  • The file size of the simplified GeoLayer will be smaller than the input GeoLayer.
  • The spatial accuracy of the simplified GeoLayer be less precise than the input GeoLayer.

Command Editor

The following dialog is used to edit the command and illustrates the command syntax.

SimplifyGeoLayerGeometry

SimplifyGeoLayerGeometry Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

SimplifyGeoLayerGeometry(Parameter="Value",...)

Command Parameters

Parameter                          Description Default                                                  
GeoLayerID
required
The ID of the GeoLayer to be simplified. None - must be specified.
Tolerance
required
The ε variable in the Douglas–Peucker algorithm.

Units are the same as the distance units of the GeoLayer's coordinate reference system. For example, WGS84 EPSG:4326 uses decimal degrees and NAD83 Zone13N EPSG:26913 uses meters. Units for common coordinate reference systems can be looked up at the epsg.io site.

Refer to the Douglas–Peucker Algorithm section for more information.
None - must be specified.
SimplifyMethod The simplification method used to simplify the GeoLayer: DouglasPeucker
SimplifiedGeoLayerID A GeoLayer identifier for the output simplified GeoLayer. Refer to documentation for best practices on naming GeoLayer identifiers. GeoLayerID``_simple_``Tolerance
IfGeoLayerIDExists The action that occurs if the SimplifiedGeoLayerID already exists within the GeoProcessor:
  • Replace - The existing GeoLayer within the GeoProcessor is replaced with the new GeoLayer. No warning is logged.
  • ReplaceAndWarn - The existing GeoLayer within the GeoProcessor is replaced with the new GeoLayer. A warning is logged.
  • Warn - The SimplifyGeoLayerGeometry command does not run. A warning is logged.
  • Fail - The SimplifyGeoLayerGeometry command does not run. A fail message is logged.
Replace

Douglas–Peucker Algorithm

The SimplifyGeoLayerGeometry command simplifies the features of a GeoLayer with the Douglas–Peucker algorithim.

A line is specified by multiple points (coordinates) in sequence. The algorithm discards points as long as the resulting shift in the line connecting remaining points does not exceed the tolerance. A very small tolerance would only discard points that are "extra" points along a straight line.

Additional Resources

Examples

See the automated tests.

The following GeoLayer data are used in the examples. The examples assume that the GeoLayer has already been read into the GeoProcessor from a file.

Example GeoLayer Data

GeoLayer ID CRS File Size (if written out to GeoJSON)
SummitCounty EPSG:26913 (NAD83 UTM Zone 13N) 90 KB

This example GeoLayer is from the polygon_summit_co_nad83_utm_z13n.geojson test data file.

SummitCounty
Original_GeoLayer

Example 1: Simplify a GeoLayer (Small Tolerance)

SimplifyGeoLayerGeometry(GeoLayerID = "SummitCounty", Tolerance = "100", SimplifiedGeoLayerID = "Summit_simple100" )

After running the command, the following GeoLayer IDs are registered within the GeoProcessor.

GeoLayer ID File Size (if written out to GeoJSON)
SummitCounty 90 KB
Summit_simple100 11 KB
Summit_simple100                      Tolerance Value: 100 meters
Simplified_GeoLayer_100
The simplified GeoLayer looks similar to the original GeoLayer. Below is an image of the two GeoLayers at a larger scale.
Original_Simplified_Overlay

Example 2: Simplify a GeoLayer (Large Tolerance)

SimplifyGeoLayerGeometry(GeoLayerID = "SummitCounty", Tolerance = "1000")

After running the command, the following GeoLayer IDs are registered within the GeoProcessor.

GeoLayer ID File Size (if written out to GeoJSON)
SummitCounty 90 KB
SummitCounty_simple_1000 2 KB
SummitCounty_simple_1000                       Tolerance Value: 1000 meters
Simplified_GeoLayer_100

Troubleshooting

See Also