odc.geo.geobox.GeoBox.from_bbox
- static GeoBox.from_bbox(bbox, crs=None, *, tight=False, shape=None, resolution=None, anchor='default', tol=0.01)[source]
Construct
GeoBox
from a bounding box.- Parameters:
bbox (
Union
[BoundingBox
,Tuple
[float
,float
,float
,float
]]) – Bounding box in CRS units, lonlat is assumed whencrs
is not suppliedcrs (
Union
[str
,int
,CRS
,CRS
,Dict
[str
,Any
],Unset
,None
]) – CRS of the bounding box (defaults to EPSG:4326)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.resolution (
Union
[float
,int
,Resolution
,None
]) – Use specified resolutiontight (
bool
) – Supplyingtight=True
turns off pixel snapping.anchor (
Union
[AnchorEnum
,XY
[float
],float
,Literal
['center'
],Literal
['centre'
],Literal
['edge'
],Literal
['floating'
],Literal
['default'
]]) – By default snaps grid such that pixel edges fall on X/Y axis. Ignored when tight mode is used.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.
- Return type:
- Returns:
GeoBox
that covers supplied bounding box.