class_docstr: Mixin providing methods for calculations related
  to transforming between rows and columns of the raster
  array and the coordinates.
  
  These methods are wrappers for the functionality in
  `rasterio.transform` module.
  
  A subclass with this mixin MUST provide a `transform`
  property.
docstr: Get the (row, col) index of the pixel containing (x, y).
  
  Parameters
  ----------
  x : float
      x value in coordinate reference system
  y : float
      y value in coordinate reference system
  z : float, optional
      Height associated with coordinates. Primarily used for RPC based
      coordinate transformations. Ignored for affine based
      transformations. Default: 0.
  op : function, optional (default: math.floor)
      Function to convert fractional pixels to whole numbers (floor,
      ceiling, round)
  transform_method: TransformMethod, optional
      The coordinate transformation method. Default: `TransformMethod.affine`.
  rpc_options: dict, optional
      Additional arguments passed to GDALCreateRPCTransformer
  precision : int, optional
      This parameter is unused, deprecated in rasterio 1.3.0, and
      will be removed in version 2.0.0.
  
  Returns
  -------
  tuple
      (row index, col index)
docstr_tok: ["Get","the","(","row",",","col",")","index","of","the","pixel","containing","(","x",",","y",")",".","Parameters","--","--","--","--","--","x",":","float","x","value","in","coordinate","reference","system","y",":","float","y","value","in","coordinate","reference","system","z",":","float",",","optional","Height","associated","with","coordinates",".","Primarily","used","for","RPC","based","coordinate","transformations",".","Ignored","for","affine","based","transformations",".","Default",":","0.","op",":","function",",","optional","(","default",":","math.floor",")","Function","to","convert","fractional","pixels","to","whole","numbers","(","floor",",","ceiling",",","round",")","transform_method",":","TransformMethod",",","optional","The","coordinate","transformation","method",".","Default",":","`","TransformMethod.affine","`",".","rpc_options",":","dict",",","optional","Additional","arguments","passed","to","GDALCreateRPCTransformer","precision",":","int",",","optional","This","parameter","is","unused",",","deprecated","in","rasterio","1.3.0",",","and","will","be","removed","in","version","2.0.0",".","Returns","--","--","--","-","tuple","(","row","index",",","col","index",")"]
code: def index(
      self,
      x,
      y,
      z=None,
      op=math.floor,
      precision=None,
      transform_method=TransformMethod.affine,
      **rpc_options,
  ):
      """Get the (row, col) index of the pixel containing (x, y).
  
      Parameters
      ----------
      x : float
          x value in coordinate reference system
      y : float
          y value in coordinate reference system
      z : float, optional
          Height associated with coordinates. Primarily used for RPC based
          coordinate transformations. Ignored for affine based
          transformations. Default: 0.
      op : function, optional (default: math.floor)
          Function to convert fractional pixels to whole numbers (floor,
          ceiling, round)
      transform_method: TransformMethod, optional
          The coordinate transformation method. Default: `TransformMethod.affine`.
      rpc_options: dict, optional
          Additional arguments passed to GDALCreateRPCTransformer
      precision : int, optional
          This parameter is unused, deprecated in rasterio 1.3.0, and
          will be removed in version 2.0.0.
  
      Returns
      -------
      tuple
          (row index, col index)
  
      """
      if precision is not None:
          warnings.warn(
              "The precision parameter is unused, deprecated, and will be removed in 2.0.0.",
              RasterioDeprecationWarning,
          )
  
      transform = getattr(self, transform_method.value)
      if transform_method is TransformMethod.gcps:
          transform = transform[0]
      if not transform:
          raise AttributeError(
              "Dataset has no {}".format(transform_method)
          )
      return rowcol(transform, x, y, zs=z, op=op, **rpc_options)
  
imports: from contextlib import ExitStack
  from functools import partial
  import math
  import numpy
  import warnings
  from affine import Affine
  from rasterio.env import env_ctx_if_needed
  from rasterio._transform import _transform_from_gcps, RPCTransformerBase, GCPTransformerBase
  from rasterio.enums import TransformDirection, TransformMethod
  from rasterio.control import GroundControlPoint
  from rasterio.rpc import RPC
  from rasterio.errors import TransformError, RasterioDeprecationWarning
label_desc: Use image node_id 2 for calling the TransformMethodsMixin obj's underlying member method code with example usage: obj.index(x, y, z, op, precision, transform_method) and returns: rowcol