code: public int[] gridAt( double x, double y ) {
          if (isInRaster(x, y)) {
              GridGeometry2D gridGeometry = getGridGeometry();
              int[] colRowFromCoordinate = CoverageUtilities.colRowFromCoordinate(new Coordinate(x, y), gridGeometry, null);
              return colRowFromCoordinate;
          }
          return null;
      }
docs: Get grid col and row from a world coordinate.
  
  @param x
  @param y
  @return the [col, row] or <code>null</code> if the position is outside the bounds.