raster_tools.Raster.index#

Raster.index(x, y)[source]#

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

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

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

Returns

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

Return type

tuple