odc.geo.geobox.GeoBox.from_geopolygon

static GeoBox.from_geopolygon(geopolygon, resolution=None, crs=None, align=None, *, shape=None, tight=False, anchor=AnchorEnum.EDGE, tol=0.01)[source]

Construct GeoBox from a polygon.

Parameters:
  • resolution (Union[float, int, Resolution, None]) – Either a single number or a Resolution object.

  • shape (Union[Tuple[int, int], XY[int], Shape2d, Index2d, int, None]) – Span that many pixels, if it’s a single number then span that many pixels along the longest dimension, other dimension will be computed to maintain roughly square pixels.

  • crs (Union[str, int, CRS, CRS, Dict[str, Any], Unset, None]) – CRS to use, if different from the geopolygon

  • align (Optional[XY[float]]) – Deprecated: please switch to anchor=

  • anchor (Union[AnchorEnum, XY[float]]) – By default snaps grid such that pixel edges fall on X/Y axis.

  • tol (float) – Fraction of a pixel that can be ignored, defaults to 1/100. Bounding box of the output geobox is allowed to be smaller than supplied bounding box by that amount.

  • tight (bool) – Supplying tight=True turns off pixel snapping.

Return type:

GeoBox