raster_tools.Raster.xy#

Raster.xy(row, col, offset='center')[source]#

Return the (x, y) coordinates of the pixel at (row, col).

Parameters
  • row (int, float, array-like) – row value(s) in the raster’s CRS

  • col (int, float, array-like) – row value(s) in the raster’s CRS

  • offset (str, optional) –

    Determines if the returned coordinates are for the center or a corner. Default is ‘center’

    ’center’

    The pixel center.

    ’ul’

    The upper left corner.

    ’ur’

    The upper right corner.

    ’ll’

    The lower left corner.

    ’lr’

    The lower right corner.

Returns

(x value(s), y value(s)). If the inputs where array-like, the output values will be arrays.

Return type

tuple