Skip to content

VectorChannel

Bases: Channel, Iterable[gpd.GeoDataFrame]

Channel that contains batched vector data

Notes
  • The data items are assumed to be normalized to the spatial extent [0, 1] in x and y direction without a coordinate reference system
  • The data property returns a reference to the data
  • The dunder methods __getitem__ and __iter__ return or yield a reference to a data item
PARAMETER DESCRIPTION
data

Data

TYPE: gpd.GeoDataFrame | list[gpd.GeoDataFrame]

name

Name

TYPE: ChannelName | str

buffer_size

Buffer size as a fraction of the spatial extent of the data

TYPE: FractionalBufferSize DEFAULT: 0.0

time_step

Time step

TYPE: TimeStep | None DEFAULT: None

copy

If True, the data is copied during initialization

TYPE: bool DEFAULT: False

name property writable

RETURNS DESCRIPTION
ChannelName | str

Name

buffer_size property

RETURNS DESCRIPTION
FractionalBufferSize

Buffer size as a fraction of the spatial extent of the data

time_step property writable

RETURNS DESCRIPTION
TimeStep | None

Time step

is_copied property

RETURNS DESCRIPTION
bool

If True, the data is copied during initialization

batch_size property

RETURNS DESCRIPTION
int

Batch size

is_in_tiles property

RETURNS DESCRIPTION
bool

True if the channel is inside tiles, False otherwise

key property

RETURNS DESCRIPTION
ChannelKey

Name and time step combination

data property

RETURNS DESCRIPTION
list[gpd.GeoDataFrame]

Data

__len__

Computes the batch size.

RETURNS DESCRIPTION
int

Batch size

from_channels classmethod

Creates a vector channel from vector channels.

PARAMETER DESCRIPTION
channels

Vector channels

TYPE: list[VectorChannel]

copy

If True, the data is copied during initialization

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
VectorChannel

Vector channel

from_unnormalized_data classmethod

Creates a vector channel from unnormalized data.

PARAMETER DESCRIPTION
data

Data

TYPE: gpd.GeoDataFrame | list[gpd.GeoDataFrame]

name

Name

TYPE: ChannelName | str

coordinates

Coordinates (x_min, y_min) of the tile or of each tile in meters

TYPE: Coordinates | CoordinatesSet

tile_size

Tile size in meters

TYPE: TileSize

buffer_size

Buffer size in meters

TYPE: BufferSize DEFAULT: 0

time_step

Time step

TYPE: TimeStep | None DEFAULT: None

copy

If True, the data is copied during initialization

TYPE: bool DEFAULT: False

__eq__

Compares the vector channels.

PARAMETER DESCRIPTION
other

Other vector channel

TYPE: object

RETURNS DESCRIPTION
bool

True if the vector channels are equal, False otherwise

__getitem__

Returns the data item.

PARAMETER DESCRIPTION
index

Index or slice of the data item

TYPE: int | slice

RETURNS DESCRIPTION
gpd.GeoDataFrame | list[gpd.GeoDataFrame]

Data item or sliced data

__iter__

Iterates over the data.

YIELDS DESCRIPTION
gpd.GeoDataFrame

Data item

__add__

Adds the vector channels.

PARAMETER DESCRIPTION
other

Other vector channel

TYPE: VectorChannel

RETURNS DESCRIPTION
VectorChannel

Vector channel

append

Appends the data.

PARAMETER DESCRIPTION
data

Data

TYPE: gpd.GeoDataFrame | list[gpd.GeoDataFrame]

inplace

If True, the data is appended inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
VectorChannel

Vector channel

copy

Copies the vector channel.

RETURNS DESCRIPTION
VectorChannel

Vector channel

remove_buffer

Removes the buffer.

PARAMETER DESCRIPTION
inplace

If True, the buffer is removed inplace

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
VectorChannel

Vector channel

to_denormalized_data

Converts the data to denormalized data.

PARAMETER DESCRIPTION
coordinates

Coordinates (x_min, y_min) of each tile in meters

TYPE: CoordinatesSet

tile_size

Tile size in meters

TYPE: TileSize

RETURNS DESCRIPTION
list[gpd.GeoDataFrame]

Data