/** * Returns a coordinate for the given two-dimensional grid coordinate axis. * This is (indirectly) a callback method for {@link #getAxes()}. */ @Override protected double coordinateForAxis(final Object axis, final int j, final int i) { return (axis instanceof CoordinateAxis2D) ? ((CoordinateAxis2D) axis).getCoordValue(j, i) : Double.NaN; } }
/** * Returns a coordinate for the given two-dimensional grid coordinate axis. * This is (indirectly) a callback method for {@link #getAxes()}. */ @Override protected double coordinateForAxis(final Variable axis, final int j, final int i) { final VariableIF v = ((VariableWrapper) axis).variable; return (v instanceof CoordinateAxis2D) ? ((CoordinateAxis2D) v).getCoordValue(j, i) : Double.NaN; } }
/** * 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); }
/** * 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 */ 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); }
LatLonPoint prev = fromProj.projToLatLon(xAxis.getCoordValue(0, 0), yAxis.getCoordValue(0, 0)); double x = xAxis.getCoordValue(i, 0); double y = yAxis.getCoordValue(i, 0); double x = xAxis.getCoordValue(xShape[0]-1, i); double y = yAxis.getCoordValue(xShape[0]-1, i); double x = xAxis.getCoordValue(i, xShape[1]-1); double y = yAxis.getCoordValue(i, xShape[1]-1); double x = xAxis.getCoordValue(0, i); double y = yAxis.getCoordValue(0, i);
LatLonPoint prev = fromProj.projToLatLon(xAxis.getCoordValue(0, 0), yAxis.getCoordValue(0, 0)); double x = xAxis.getCoordValue(i, 0); double y = yAxis.getCoordValue(i, 0); double x = xAxis.getCoordValue(xShape[0]-1, i); double y = yAxis.getCoordValue(xShape[0]-1, i); double x = xAxis.getCoordValue(i, xShape[1]-1); double y = yAxis.getCoordValue(i, xShape[1]-1); double x = xAxis.getCoordValue(0, i); double y = yAxis.getCoordValue(0, i);
LatLonPoint prev = fromProj.projToLatLon(xAxis.getCoordValue(0, 0), yAxis.getCoordValue(0, 0)); double x = xAxis.getCoordValue(i, 0); double y = yAxis.getCoordValue(i, 0); double x = xAxis.getCoordValue(xShape[0]-1, i); double y = yAxis.getCoordValue(xShape[0]-1, i); double x = xAxis.getCoordValue(i, xShape[1]-1); double y = yAxis.getCoordValue(i, xShape[1]-1); double x = xAxis.getCoordValue(0, i); double y = yAxis.getCoordValue(0, i);
double lat = lat_axis.getCoordValue(j, i); double lon = lon_axis.getCoordValue(j, i);
double lat = lat_axis.getCoordValue(j, i); double lon = lon_axis.getCoordValue(j, i);
double lat = lat_axis.getCoordValue(j, i); double lon = lon_axis.getCoordValue(j, i);
dtCoords.set("timeDateIntv", timeBoundsDate); } else { double timeCoord = tcoord2D.getCoordValue(rtIndex, t); CalendarDate timeCoordDate = helper.makeCalendarDateFromOffset(timeCoord); dtCoords.setTime(timeCoordDate);