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/Y axis.

Parameters:
  • xxX axis coordinates

  • yyY axis coordinates

  • fallback_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:

ValueError when any axis is empty.

Raises:

ValueError when any axis has single value and fallback resolution was not supplied.