Skip to content

AggregateProcessor

Vector processor that aggregates a layer

The polygons are aggregated by value into the aggregation layer with absolute and relative area fields.

Implements the VectorProcessor protocol.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

aggregation_layer_name

Aggregation layer name

TYPE: str

field

Field

TYPE: str

values

Value, values, no values (False or None), or all values (True)

TYPE: str | int | set[str | int] | bool | None DEFAULT: True

background_value

Background value

TYPE: str | int | None DEFAULT: None

absolute_area_field_suffix

Suffix of the absolute area field

TYPE: str DEFAULT: 'absolute_area'

relative_area_field_suffix

Suffix of the relative area field

TYPE: str DEFAULT: 'relative_area'

new_aggregation_layer_name

New aggregation layer name

TYPE: str | None DEFAULT: None

from_config classmethod

Creates an aggregate processor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: AggregateProcessorConfig

RETURNS DESCRIPTION
AggregateProcessor

Aggregate processor

__call__

Aggregates the layer.

PARAMETER DESCRIPTION
vector

Vector

TYPE: Vector

RETURNS DESCRIPTION
Vector

Vector


AggregateProcessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of AggregateProcessor

Create the configuration from a config file
  • Use null instead of None
  • Use false or true instead of False or True
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'AggregateProcessor'
config:
  layer_name: 'my_layer'
  aggregation_layer_name: 'my_aggregation_layer'
  field: 'prediction'
  values: true
  background_value: null
  absolute_area_field_suffix: 'absolute_area'
  relative_area_field_suffix: 'relative_area'
  new_aggregation_layer_name: 'my_new_aggregation_layer'
ATTRIBUTE DESCRIPTION
layer_name

Layer name

TYPE: str

aggregation_layer_name

Aggregation layer name

TYPE: str

field

Field

TYPE: str

values

Value, values, no values (False or None), or all values (True) - defaults to True

TYPE: str | int | set[str | int] | bool | None

background_value

Background value - defaults to None

TYPE: str | int | None

absolute_area_field_suffix

Suffix of the absolute area field - defaults to 'absolute_area'

TYPE: str

relative_area_field_suffix

Suffix of the relative area field - defaults to 'relative_area'

TYPE: str

new_aggregation_layer_name

New aggregation layer name - defaults to None

TYPE: str | None