Skip to main content

Generalize

The Generalize gem reduces the number of vertices in polygons and polylines while preserving their overall shape. This is useful for reducing file sizes, improving rendering performance, and simplifying complex geometries for analysis or visualization.

tip

Input geometries must be in WKT format. Use the PolyBuild gem to convert longitude and latitude coordinates into polygons or polylines in WKT format.

info

The gem uses the Ramer–Douglas–Peucker algorithm, which removes vertices based on their perpendicular distance from line segments. You can control the level of simplification by adjusting the distance threshold.

Input and Output

The Generalize gem accepts the following input and output.

PortDescription
in0Source dataset containing a column with lines or polygons.
outOutput dataset containing a new column with the transformed lines or polygons.

Parameters

Configure the Generalize gem using the following parameters.

ParameterDescription
Geometry columnColumn containing the WKT geometries to generalize.
ThresholdDistance threshold for vertex removal.
Vertices closer than this distance to the line segment connecting their neighbors will be removed.
UnitsUnit of measurement for the threshold in miles or kilometers.