gpf_entrepot_toolbelt.orchestrator.models.bbox module

class gpf_entrepot_toolbelt.orchestrator.models.bbox.GpfBbox(bbox: tuple[float] = [])

Bases : object

GPF Bbox class.

Exemple

bbox = GpfBbox([2.1,-1.3,46.2,22.0])
__init__(bbox: tuple[float] = [])

Object initialization.

Paramètres:

bbox (Tuple[float], optional) – geographical bbox (East, West, North, South)

add_bbox(bbox: Self)

Ajoute la bbox en parametre à la bbox actuelle

Paramètres:

bbox (GpfBbox) – BBox to add

classmethod from_dict(val: dict) Self

Load object from a dict.

Paramètres:

val (dict) – dict value to load

Renvoie:

object with attributes filled from dict.

Type renvoyé:

Self

Exemple

bbox = GpfBbox.from_dict(
        {
            "east" : 2.1,
            "west" : -1.3,
            "north" : 46.2,
            "south" : 22.0
        }
    )
print(bbox.east)
classmethod from_wkt(wkt: str) Self

Build a bounding box from a WKT geometry

Paramètres:

wkt (str) – WKT geometry

Renvoie:

object with attributes filled from wkt

Type renvoyé:

Self

is_valid() bool

Check if bbox is valid

Renvoie:

True if bbox is valid

False otherwise

Type renvoyé:

bool

static is_valid_bbox(bbox: tuple[float]) bool

Check if bbox is valid

Paramètres:

bbox (Tuple[float]) – geographical bbox (East, West, North, South)

Renvoie:

True if bbox is valid

False otherwise

Type renvoyé:

bool

to_dict() dict | None

Convert dataclass object into dictionary. Supersedes dataclass.asdict.

Renvoie:

object as dictionary

Type renvoyé:

dict

Exemple

bbox = GpfBbox([2.1,-1.3,46.2,22.0])
print(bbox.to_dict())
to_list() list

Returns BBox as list

Renvoie:

geographical bbox (East, West, North, South)

Type renvoyé:

list