odc.geo.math.affine_from_axis
- odc.geo.math.affine_from_axis(xx, yy, fallback_resolution=None)[source]
Compute Affine transform from axis.
Transform direction is from pixel coordinates to CRS units of
X/Yaxis.- Parameters:
xx –
Xaxis coordinatesyy –
Yaxis coordinatesfallback_resolution (
Union[float,int,Resolution,None]) – Resolution to assume for single element axis.
- Return type:
Affine
(0,0) in pixel space is defined as top left corner of the top left pixel | V 0 1 +---+---+ 0 | | | +---+---+ 1 | | | +---+---+
Only uses first two coordinate values, assumes that data is regularly sampled.
- Raises:
ValueErrorwhen any axis is empty.- Raises:
ValueErrorwhen any axis has single value and fallback resolution was not supplied.