Skip to content

MapFieldProcessor

Vector processor that maps a field of a layer

Implements the VectorProcessor protocol.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

field

Field

TYPE: str

mapping

Mapping of the values

TYPE: dict[object, object]

new_layer_name

New layer name

TYPE: str | None DEFAULT: None

from_config classmethod

Creates a map field processor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: MapFieldProcessorConfig

RETURNS DESCRIPTION
MapFieldProcessor

Map Field processor

__call__

Maps the field of the layer.

PARAMETER DESCRIPTION
vector

Vector

TYPE: Vector

RETURNS DESCRIPTION
vector

Vector

TYPE: Vector


MapFieldProcessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of MapFieldProcessor

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: 'MapFieldProcessor'
config:
  layer_name: 'my_layer'
  field: 'my_field'
  mapping:
    'old_value': 'new_value'
  new_layer_name: 'my_new_layer'
ATTRIBUTE DESCRIPTION
layer_name

Layer name

TYPE: str

field

Field

TYPE: str

mapping

Mapping of the values

TYPE: dict[object, object]

new_layer_name

New layer name - defaults to None

TYPE: str | None