monkey_wrench.geometry package
- class monkey_wrench.geometry.Area(*, area: Path, ~pydantic.types.PathType(path_type=file), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.<lambda>)] | dict[str, ~typing.Any] | ~pyresample.geometry.AreaDefinition)[source]
Bases:
Model- area: AreaDefinition
A filepath, a dictionary, or an object of type AreaDefinition which holds the area information for resampling.
- class monkey_wrench.geometry.BoundingBox(north: float = None, south: float = None, west: float = None, east: float = None)[source]
Bases:
BaseModelPydantic model for a bounding box.
Example
>>> BoundingBox(north=10, south=20, west=30, east=40) BoundingBox(north=10.0, south=20.0, west=30.0, east=40.0)
>>> BoundingBox(10, 20, 30, 40) BoundingBox(north=10.0, south=20.0, west=30.0, east=40.0)
- north: float
- south: float
- west: float
- east: float
- serialize(as_string: bool = False, delimiter: str = ' ') list[float] | str[source]
Get the serialized version of the bounding box.
- Parameters:
as_string – If
True, return a string representation of the bounding box.delimiter – The delimiter to use in the serialized version of the bounding box, if
as_stringisTrue. Defaults to a blank space.
- Returns:
Either a string, or a list of floats as
[<North>, <South>, <West>, <East>].
- class monkey_wrench.geometry.Polygon(vertices: list[Vertex] = None)[source]
Bases:
BaseModelThe Pydantic model for a polygon.
Example
>>> polygon: Polygon = Polygon(vertices=[ ... Vertex(14.0, 64.0), ... Vertex(16.0, 64.0), ... Vertex(16.0, 62.0), ... Vertex(14.0, 62.0), ... Vertex(14.0, 64.0), ... ])
- class monkey_wrench.geometry.Vertex(longitude: float = None, latitude: float = None)[source]
Bases:
BaseModelPydantic model for a vertex.
Example
>>> Vertex(longitude=10, latitude=20) Vertex(longitude=10.0, latitude=20.0)
>>> Vertex(10, 20) Vertex(longitude=10.0, latitude=20.0)
- longitude: float
- latitude: float
- serialize(as_string: bool = False, delimiter: str = ' ') list[float] | str[source]
Get the serialized version of the vertex.
- Parameters:
as_string – If
True, return a string representation of the vertex.delimiter – The delimiter to use in the serialized version of the vertex, if
as_stringisTrue. Defaults to a blank space.
- Returns:
Either a string, or a list of floats as
[<longitude>, <latitude>].