easysnowdata.aoi.AOI#

class easysnowdata.aoi.AOI(footprint: GeoDataFrame, clip: bool = True, geobox: GeoBox | None = None, source_crs: CRS = <factory>, crosses_antimeridian: bool = False)[source]#

Bases: object

A parsed area of interest: footprint in EPSG:4326 plus an optional grid.

Build one with parse_aoi(); loaders accept either form.

footprint#

Single-row GeoDataFrame in EPSG:4326. A MultiPolygon when the AOI crosses the antimeridian.

Type:

geopandas.geodataframe.GeoDataFrame

clip#

Whether loaders should clip rasters/vectors to the footprint (True) or return the covering tiles/granules (False).

Type:

bool

geobox#

The native grid when the AOI was built from a GeoBox, else None. to_geobox() returns it when no other grid is requested.

Type:

odc.geo.geobox.GeoBox | None

source_crs#

CRS of the input (EPSG:4326 for tuples and shapely geometries).

Type:

pyproj.crs.crs.CRS

crosses_antimeridian#

True when the footprint straddles ±180°.

Type:

bool

property geometry: Geometry#
Type:

The footprint as one shapely geometry in EPSG

property unwrapped_geometry: Geometry#

The footprint with longitudes in 0…360 when it crosses ±180°.

property bounds: tuple[float, float, float, float]#

4326 (STAC convention: west > east across ±180°).

Type:

(west, south, east, north) in EPSG

property is_global: bool#

True when the footprint covers the whole globe.

property stac_bbox: list[float]#

The bounds as a STAC bbox list.

property stac_intersects: dict[str, Any]#

The footprint as a GeoJSON geometry mapping for STAC intersects.

property utm_crs: CRS#

The UTM zone (or polar stereographic fallback) at the AOI centroid.

to_crs(crs: Any) GeoDataFrame[source]#

Reproject the footprint, unwrapping it across ±180° for projected CRSs.

total_bounds(crs: Any = 'EPSG:4326') tuple[float, float, float, float][source]#

Rectangular bounds of the footprint in crs (unwrapped across ±180°).

to_geobox(resolution: float | tuple[float, float] | Resolution | None = None, crs: Any = None, *, shape: int | tuple[int, int] | None = None, anchor: Any = 'default') GeoBox[source]#

Return a grid covering the footprint.

Parameters:
  • resolution – Pixel size in CRS units (metres for UTM, degrees for EPSG:4326). A scalar gives square pixels with a negative y step.

  • crs – Target CRS. None or "utm" selects utm_crs.

  • shape – Alternative to resolution: number of pixels ((ny, nx) or one value for the longer side).

  • anchor – Passed to odc.geo.geobox.GeoBox.from_geopolygon().

  • built (With no arguments the native GeoBox is returned when the AOI was)

  • required. (from one; otherwise resolution or shape is)

buffer(distance: float) AOI[source]#

Return a new AOI buffered by distance metres (computed in UTM).

with_clip(clip: bool) AOI[source]#

Return a copy with the clip flag set to clip.