Skip to content

Vector

Bases: Iterable[VectorLayer]

The vector specifies the layers.

Notes
  • The layers property returns a reference to the layers
  • The metadata property returns a reference to the metadata
  • The dunder methods __getattr__, __getitem__, and __iter__ return or yield a reference to a layer
PARAMETER DESCRIPTION
layers

Layers

TYPE: list[VectorLayer]

metadata

Metadata

TYPE: dict[str, object] | None DEFAULT: None

copy

If True, the layers and metadata are copied during initialization

TYPE: bool DEFAULT: False

layers property

RETURNS DESCRIPTION
list[VectorLayer]

Layers

metadata property writable

RETURNS DESCRIPTION
dict[str, object]

Metadata

is_copied property

RETURNS DESCRIPTION
bool

If True, the layers and metadata are copied during initialization

layer_names property

RETURNS DESCRIPTION
set[str]

Layer names

from_vectors classmethod

Creates vector from vectors.

PARAMETER DESCRIPTION
vectors

Vectors

TYPE: list[Vector]

copy

If True, the layers and metadata are copied during initialization

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Vector

Vector

__eq__

Compares the vectors.

PARAMETER DESCRIPTION
other

Other vector

TYPE: object

RETURNS DESCRIPTION
bool

True if the vectors are equal, False otherwise

__len__

Computes the number of layers.

RETURNS DESCRIPTION
int

Number of layers

__bool__

Checks if the vector contains layers.

RETURNS DESCRIPTION
bool

True if the vector contains layers, False otherwise

__contains__

Checks if the layer is in the vector.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

RETURNS DESCRIPTION
bool

True if the layer is in the vector, False otherwise

__getattr__

Returns the layer.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

RETURNS DESCRIPTION
VectorLayer

Layer

__getitem__

Returns the layer.

PARAMETER DESCRIPTION
layer_name

Layer name

TYPE: str

RETURNS DESCRIPTION
VectorLayer

Layer

__iter__

Iterates over the layers.

YIELDS DESCRIPTION
VectorLayer

Layer

__add__

Adds the vectors.

PARAMETER DESCRIPTION
other

Other vector

TYPE: Vector

RETURNS DESCRIPTION
Vector

Vector

append

Appends the layers.

PARAMETER DESCRIPTION
layers

Layers

TYPE: VectorLayer | list[VectorLayer]

inplace

If True, the layers are appended inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Vector

Vector

copy

Copies the vector.

RETURNS DESCRIPTION
Vector

Vector

remove

Removes the layers.

PARAMETER DESCRIPTION
layer_names

Layer name, layer names, no layers (False or None), or all layers (True)

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

inplace

If True, the layers are removed inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Vector

Vector

select

Selects the layers.

PARAMETER DESCRIPTION
layer_names

Layer name, layer names, no layers (False or None), or all layers (True)

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

inplace

If True, the layers are selected inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Vector

Vector