/** * Is this a global coverage over longitude ? * @return true if isLatLon and longitude wraps */ @Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = Math.min(first, last); double max = Math.max(first, last); return (max - min) >= 360; }
/** * Is this a global coverage over longitude ? * @return true if isLatLon and longitude wraps */ @Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = Math.min(first, last); double max = Math.max(first, last); return (max - min) >= 360; }
/** * Is this a global coverage over longitude ? * @return true if isLatLon and longitude wraps */ @Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = Math.min(first, last); double max = Math.max(first, last); return (max - min) >= 360; }
/** * Get the coordinate bounds for the ith coordinate. * Can use this for isContiguous() true or false. * * @param i coordinate index * @return double[2] edges for ith coordinate */ public double[] getCoordBounds(int i) { if (!wasBoundsDone) makeBounds(); double[] e = new double[2]; if (isContiguous()) { e[0] = getCoordEdge(i); e[1] = getCoordEdge(i + 1); } else { e[0] = bound1[i]; e[1] = bound2[i]; } return e; }
/** * Get the coordinate bounds for the ith coordinate. * Can use this for isContiguous() true or false. * * @param i coordinate index * @return double[2] edges for ith coordinate */ public double[] getCoordBounds(int i) { if (!wasBoundsDone) makeBounds(); double[] e = new double[2]; if (isContiguous()) { e[0] = getCoordEdge(i); e[1] = getCoordEdge(i + 1); } else { e[0] = bound1[i]; e[1] = bound2[i]; } return e; }
/** * Is this a global coverage over longitude ? * * @return true if isLatLon and longitude wraps */ public boolean isGlobalLon() { if (!isLatLon) return false; if (!(getXHorizAxis() instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) getXHorizAxis(); double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = Math.min(first, last); double max = Math.max(first, last); return (max - min) >= 360; }
/** * Get the coordinate edges for the ith coordinate. * Can use this for isContiguous() true or false. * * @param i coordinate index * @return double[2] edges for ith coordinate */ public double[] getCoordEdges(int i) { if (!wasBoundsDone) makeBounds(); if (!isContiguous()) makeBoundsFromEdges(); double[] e = new double[2]; if (isContiguous()) { e[0] = getCoordEdge(i); e[1] = getCoordEdge(i + 1); } else { e[0] = bound1[i]; e[1] = bound2[i]; } return e; }
mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize()));
mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize()));
mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize()));
mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize()));
private void makeBoundingBox() { // x,y may be 2D if (!(getXHorizAxis() instanceof CoordinateAxis1D) || !(getYHorizAxis() instanceof CoordinateAxis1D)) { CoordinateAxis xaxis = getXHorizAxis(); CoordinateAxis yaxis = getYHorizAxis(); /* could try to optimize this - just get cord=ners or something CoordinateAxis2D xaxis2 = (CoordinateAxis2D) horizXaxis; CoordinateAxis2D yaxis2 = (CoordinateAxis2D) horizYaxis; MAMath.MinMax */ mapArea = new ProjectionRect(xaxis.getMinValue(), yaxis.getMinValue(), xaxis.getMaxValue(), yaxis.getMaxValue()); } else { CoordinateAxis1D xaxis1 = (CoordinateAxis1D) getXHorizAxis(); CoordinateAxis1D yaxis1 = (CoordinateAxis1D) getYHorizAxis(); /* add one percent on each side if its a projection. WHY? double dx = 0.0, dy = 0.0; if (!isLatLon()) { dx = .01 * (xaxis1.getCoordEdge((int) xaxis1.getSize()) - xaxis1.getCoordEdge(0)); dy = .01 * (yaxis1.getCoordEdge((int) yaxis1.getSize()) - yaxis1.getCoordEdge(0)); } mapArea = new ProjectionRect(xaxis1.getCoordEdge(0) - dx, yaxis1.getCoordEdge(0) - dy, xaxis1.getCoordEdge((int) xaxis1.getSize()) + dx, yaxis1.getCoordEdge((int) yaxis1.getSize()) + dy); */ mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize())); } }
private void makeBoundingBox() { // x,y may be 2D if (!(getXHorizAxis() instanceof CoordinateAxis1D) || !(getYHorizAxis() instanceof CoordinateAxis1D)) { CoordinateAxis xaxis = getXHorizAxis(); CoordinateAxis yaxis = getYHorizAxis(); /* could try to optimize this - just get cord=ners or something CoordinateAxis2D xaxis2 = (CoordinateAxis2D) horizXaxis; CoordinateAxis2D yaxis2 = (CoordinateAxis2D) horizYaxis; MAMath.MinMax */ mapArea = new ProjectionRect(xaxis.getMinValue(), yaxis.getMinValue(), xaxis.getMaxValue(), yaxis.getMaxValue()); } else { CoordinateAxis1D xaxis1 = (CoordinateAxis1D) getXHorizAxis(); CoordinateAxis1D yaxis1 = (CoordinateAxis1D) getYHorizAxis(); /* add one percent on each side if its a projection. WHY? double dx = 0.0, dy = 0.0; if (!isLatLon()) { dx = .01 * (xaxis1.getCoordEdge((int) xaxis1.getSize()) - xaxis1.getCoordEdge(0)); dy = .01 * (yaxis1.getCoordEdge((int) yaxis1.getSize()) - yaxis1.getCoordEdge(0)); } mapArea = new ProjectionRect(xaxis1.getCoordEdge(0) - dx, yaxis1.getCoordEdge(0) - dy, xaxis1.getCoordEdge((int) xaxis1.getSize()) + dx, yaxis1.getCoordEdge((int) yaxis1.getSize()) + dy); */ mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize())); } }
double xStart = xaxis.getCoordEdge(0) * scaler; double yStart = yaxis.getCoordEdge(0) * scaler; double xInc = xaxis.getIncrement() * scaler; double yInc = Math.abs(yaxis.getIncrement()) * scaler; yStart = yaxis.getCoordEdge((int) yaxis.getSize()) * scaler;
double xStart = xaxis.getCoordEdge(0) * scaler; double yStart = yaxis.getCoordEdge(0) * scaler; double xInc = xaxis.getIncrement() * scaler; double yInc = Math.abs(yaxis.getIncrement()) * scaler; yStart = yaxis.getCoordEdge((int) yaxis.getSize()) * scaler;
double xStart = xaxis.getCoordEdge(0) * scaler; double yStart = yaxis.getCoordEdge(0) * scaler; double xInc = xaxis.getIncrement() * scaler; double yInc = Math.abs(yaxis.getIncrement()) * scaler; yStart = yaxis.getCoordEdge((int) yaxis.getSize()) * scaler;