odc.geo.overlap.compute_output_geobox
- odc.geo.overlap.compute_output_geobox(gbox, crs, *, resolution='auto', shape=None, tight=False, anchor='default', tol=0.01, round_resolution=None)[source]
Compute output
GeoBox.Find best fitting, axis aligned GeoBox in a different coordinate reference given source
GeoBoxon input.- Parameters:
gbox (
Union[GeoBox,GCPGeoBox]) – Source geobox.crs (
Union[str,int,CRS,CRS,Dict[str,Any]]) – Desired CRS of the outputresolution (
Union[float,int,Resolution,Literal['auto','fit','same']]) –“same” use exactly the same resolution as src
”fit” use center pixel to determine scale change between the two
- ”auto” is to use the same resolution on the output if CRS units arethe same between the source and destination and otherwise use “fit”
Ignored if
shape=is suppliedElse resolution in the units of the output crs
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. Takes precedence overresolution=parameter.tight (
bool) – By default output pixel grid is adjusted to align pixel edges to X/Y axis, supplingtight=Trueproduces unaligned geobox on the output.anchor (
Union[AnchorEnum,XY[float],float,Literal['center'],Literal['centre'],Literal['edge'],Literal['floating'],Literal['default']]) – Control pixel snapping, default is to snap pixel edge toX=0,Y=0. Ignored whentight=Trueis supplied.tol (
float) – Fraction of the output pixel that can be ignored, defaults to 1/100. Bounding box of the output geobox is allowed to be smaller by that amount than transformed footprint of the original.round_resolution (
Union[None,bool,Callable[[float,str],float]]) –round_resolution(res: float, units: str) -> float
- Return type:
- Returns:
Similar resolution, axis aligned geobox that fully encloses source one but in a different projection.