cdm/src/main/java/ucar/nc2/ft2/coverage/adapter/DtCoverageCS.java
public LatLonPoint getLatLon(int xindex, int yindex) {
    double x, y;

    CoordinateAxis horizXaxis = getXHorizAxis();
    CoordinateAxis horizYaxis = getYHorizAxis();
    if (horizXaxis instanceof CoordinateAxis1D) {
      CoordinateAxis1D horiz1D = (CoordinateAxis1D) horizXaxis;
      x = horiz1D.getCoordValue(xindex);
    } else {
      CoordinateAxis2D horiz2D = (CoordinateAxis2D) horizXaxis;
      x = horiz2D.getCoordValue(yindex, xindex);
    }

    if (horizYaxis instanceof CoordinateAxis1D) {
      CoordinateAxis1D horiz1D = (CoordinateAxis1D) horizYaxis;
      y = horiz1D.getCoordValue(yindex);
    } else {
      CoordinateAxis2D horiz2D = (CoordinateAxis2D) horizYaxis;
      y = horiz2D.getCoordValue(yindex, xindex);
    }

    return isLatLon() ? new LatLonPointImpl(y, x) : getLatLon(x, y);
  }
public LatLonPoint getLatLon(int xindex, int yindex) {
    double x, y;

    CoordinateAxis horizXaxis = getXHorizAxis();
    CoordinateAxis horizYaxis = getYHorizAxis();
    if (horizXaxis instanceof CoordinateAxis1D) {
      CoordinateAxis1D horiz1D = (CoordinateAxis1D) horizXaxis;
      x = horiz1D.getCoordValue(xindex);
    } else {
      CoordinateAxis2D horiz2D = (CoordinateAxis2D) horizXaxis;
      x = horiz2D.getCoordValue(yindex, xindex);
    }

    if (horizYaxis instanceof CoordinateAxis1D) {
      CoordinateAxis1D horiz1D = (CoordinateAxis1D) horizYaxis;
      y = horiz1D.getCoordValue(yindex);
    } else {
      CoordinateAxis2D horiz2D = (CoordinateAxis2D) horizYaxis;
      y = horiz2D.getCoordValue(yindex, xindex);
    }

    return isLatLon() ? new LatLonPointImpl(y, x) : getLatLon(x, y);
  }
public LatLonPoint getLatLon ( int xindex , int yindex ) { double x , y ; CoordinateAxis horizXaxis = getXHorizAxis ( ) ; CoordinateAxis horizYaxis = getYHorizAxis ( ) ; if ( horizXaxis instanceof CoordinateAxis1D ) { CoordinateAxis1D horiz1D = ( CoordinateAxis1D ) horizXaxis ; x = horiz1D . getCoordValue ( xindex ) ; } else { CoordinateAxis2D horiz2D = ( CoordinateAxis2D ) horizXaxis ; x = horiz2D . getCoordValue ( yindex , xindex ) ; } if ( horizYaxis instanceof CoordinateAxis1D ) { CoordinateAxis1D horiz1D = ( CoordinateAxis1D ) horizYaxis ; y = horiz1D . getCoordValue ( yindex ) ; } else { CoordinateAxis2D horiz2D = ( CoordinateAxis2D ) horizYaxis ; y = horiz2D . getCoordValue ( yindex , xindex ) ; } return isLatLon ( ) ? new LatLonPointImpl ( y , x ) : getLatLon ( x , y ) ; }
Get the Lat/Lon coordinates of the midpoint of a grid cell, using the x,y indices

@param xindex x index
@param yindex y index
@return lat/lon coordinate of the midpoint of the cell
Get the Lat / Lon coordinates of the midpoint of a grid cell using the x y indices