> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simplify

> Decrease the number of nodes that make up a polygon or polyline

export const gemName_0 = "Simplify"

export const execution_engine_0 = "the SQL warehouse"

<Info>This gem runs in {execution_engine_0}.</Info>

## Overview

The Simplify 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.

The gem uses the [Ramer-Douglas-Peucker
algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm), which
removes vertices based on their perpendicular distance from line segments. You can control the
level of simplification by adjusting the distance threshold.

<Tip>
  The {gemName_0} gem has a corresponding interactive gem example. See [Interactive gem
  examples](/data-analysis/gems/gems#interactive-gem-examples) to learn how to run sample pipelines
  for this and other gems.
</Tip>

## Prerequisites

* Add `ProphecyDatabricksSqlSpatial` version 0.0.4 or higher to your project.

## Input and Output

The Simplify gem accepts the following input and output.

| Port    | Description                                                                    |
| ------- | ------------------------------------------------------------------------------ |
| **in0** | Source dataset containing a column with lines or polygons.                     |
| **out** | Output dataset containing a new column with the transformed lines or polygons. |

<Note>
  Input geometries must be in
  [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) format. Use the
  [PolyBuild](/data-analysis/gems/spatial/polybuild) gem to convert longitude and latitude
  coordinates into polygons or polylines in WKT format.
</Note>

## Parameters

Configure the Simplify gem using the following parameters.

| Parameter       | Description                                                                                                                                     |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Geometry column | Column containing the WKT geometries to simplify.                                                                                               |
| Tolerance       | Distance threshold for vertex removal. <br />Vertices closer than this distance to the line segment connecting their neighbors will be removed. |
| Units           | Unit of measurement for the threshold in miles or kilometers.                                                                                   |
