⚠️ Our 0.1 release refactored several early-development functions for long-term stability, to update your code see here. ⚠️
Future changes will come with deprecation warnings! 🙂




Raster.xy2ij(x, y, op=<class 'numpy.float32'>, precision=None, shift_area_or_point=None)[source]#

Get indexes (row,column) of coordinates (x,y).

By default, the indexes are shifted with the interpretation of pixel coordinates “AREA_OR_POINT” of the raster, to ensure that the indexes of points represent the right location. See parameter description of shift_area_or_point for more details.

This function is reversible with ij2xy for any pixel interpretation.

Returns i, j:

Indices of (x,y) in the image.

Return type:

tuple[ndarray[Any, dtype[Union[floating[Any], integer[Any]]]], ndarray[Any, dtype[Union[floating[Any], integer[Any]]]]]