/** * 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 */ @Override public LatLonPoint getLatLon(int xindex, int yindex) { double x, y; 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 */ @Override public LatLonPoint getLatLon(int xindex, int yindex) { double x, y; 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 */ @Override public LatLonPoint getLatLon(int xindex, int yindex) { double x, y; 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); }