Types¶
aef_bng.types
¶
Type definitions used.
Currently focuses on bounding box definitions and helper methods for simple use.
BoundingBox(minx, miny, maxx, maxy)
dataclass
¶
as_tuple()
¶
as_list()
¶
to_geojson()
¶
Returns the bounding box as a GeoJSON Polygon geometry dictionary. Note: GeoJSON expects coordinates in EPSG:4326 (WGS84).
Source code in aef_bng/types.py
to_geodataframe(crs=None)
¶
Returns the bounding box as a GeoPandas GeoDataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
crs
|
str | int | CRS | None
|
The Coordinate Reference System of the bounding box. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
A GeoDataFrame containing the bounding box as a single polygon geometry. |
Source code in aef_bng/types.py
reproject(from_crs, to_crs)
¶
Reprojects the bounding box coordinates to a new CRS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_crs
|
str | int
|
The source CRS (e.g., "EPSG:4326" or 4326). |
required |
to_crs
|
str | int
|
The target CRS (e.g., "EPSG:27700" or 27700). |
required |
Returns:
| Type | Description |
|---|---|
BoundingBox
|
A new BoundingBox instance with transformed coordinates. |