odc.geo.XY

class odc.geo.XY(x, y)[source]

Immutable container for anything X/Y.

This class is used as a replacement for a plain tuple of two values that could be in X/Y or Y/X order.

Parameters:
  • x (TypeVar(T)) – Value of type T for x

  • y (TypeVar(T)) – Value of type T for y

__init__(x, y)[source]

Methods

__init__(x, y)

map(op)

Apply function to x and y and return new XY value.

Attributes

aspect

Aspect ratio (X/Y).

lat

Access Latitude value (Y).

latlon

Convert to tuple in Latitude,Longitude order.

lon

Access Longitude value (X).

lonlat

Convert to tuple in Longitude,Latitude order.

shape

Interpret as shape (Y, X) order.

wh

Interpret as width, height, (X, Y) order.

x

Access X value.

xy

Convert to tuple in X,Y order.

y

Access Y value.

yx

Convert to tuple in Y,X order.