Skip to content

SimplifyProcessor

Vector processor that simplifies a layer

The polygons are simplified using a topology-preserving Visvalingam-Whyatt algorithm.

Implements the VectorProcessor protocol.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

threshold

Threshold (the minimum area of the triangle defined by three consecutive vertices to retain) in square meters

TYPE: float

new_layer_name

New layer name

TYPE: str | None DEFAULT: None

from_config classmethod

Creates a simplify processor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: SimplifyProcessorConfig

RETURNS DESCRIPTION
SimplifyProcessor

Simplify processor

__call__

Simplifies the layer.

PARAMETER DESCRIPTION
vector

Vector

TYPE: Vector

RETURNS DESCRIPTION
vector

Vector

TYPE: Vector


SimplifyProcessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of SimplifyProcessor

Create the configuration from a config file
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'SimplifyProcessor'
config:
  layer_name: 'my_layer'
  threshold: 1.
  new_layer_name: 'my_new_layer'
ATTRIBUTE DESCRIPTION
layer_name

Layer name

TYPE: str

threshold

Threshold (the minimum area of the triangle defined by three consecutive vertices to retain) in square meters

TYPE: float

new_layer_name

New layer name - defaults to None

TYPE: str | None