public boolean isRegular() { return coordinateAxis instanceof CoordinateAxis1D && ((CoordinateAxis1D) coordinateAxis).isRegular(); }
private boolean isRegularSpatial(CoordinateAxis axis) { if (axis == null) return true; if (!(axis instanceof CoordinateAxis1D)) return false; return ((CoordinateAxis1D) axis).isRegular(); }
/** true if all axes are CoordinateAxis1D and are regular * * @return true if all axes are CoordinateAxis1D and are regular */ public boolean isRegular() { for (CoordinateAxis axis : coordAxes) { if (!(axis instanceof CoordinateAxis1D)) return false; if (!((CoordinateAxis1D) axis).isRegular()) return false; } return true; }
/** true if all axes are CoordinateAxis1D and are regular * * @return true if all axes are CoordinateAxis1D and are regular */ public boolean isRegular() { for (CoordinateAxis axis : coordAxes) { if (!(axis instanceof CoordinateAxis1D)) return false; if (!((CoordinateAxis1D) axis).isRegular()) return false; } return true; }
private boolean isRegularSpatial(CoordinateAxis axis) { if (axis == null) return true; if (!(axis instanceof CoordinateAxis1D)) return false; if (!((CoordinateAxis1D) axis).isRegular()) return false; return true; }
private boolean isRegularSpatial(CoordinateAxis axis) { if (axis == null) return true; if (!(axis instanceof CoordinateAxis1D)) return false; return ((CoordinateAxis1D) axis).isRegular(); }
private boolean isRegularSpatial(CoordinateAxis axis) { if (axis == null) return true; if (!(axis instanceof CoordinateAxis1D)) return false; return ((CoordinateAxis1D) axis).isRegular(); }
/** true if all axes are CoordinateAxis1D and are regular * * @return true if all axes are CoordinateAxis1D and are regular */ public boolean isRegular() { for (CoordinateAxis axis : coordAxes) { if (!(axis instanceof CoordinateAxis1D)) return false; if (!((CoordinateAxis1D) axis).isRegular()) return false; } return true; }
public boolean isRegular() { return coordinateAxis instanceof CoordinateAxis1D && ((CoordinateAxis1D) coordinateAxis).isRegular(); }
public boolean isRegular(){ return coordinateAxis.isRegular(); }
/** * Given a coordinate position, find what grid element contains it, or is closest to it. * * @param coordVal position in this coordinate system * @return index of grid point containing it, or best estimate of closest grid interval. */ public int findCoordElementBounded(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElementBounded() on non-numeric"); if (isRegular()) return findCoordElementRegular(coordVal, true); if (isContiguous()) return findCoordElementIrregular(coordVal, true); else return findCoordElementNonContiguous(coordVal, true); }
/** * Given a coordinate position, find what grid element contains it, or is closest to it. * * @param coordVal position in this coordinate system * @return index of grid point containing it, or best estimate of closest grid interval. */ public int findCoordElementBounded(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElementBounded() on non-numeric"); if (isRegular()) return findCoordElementRegular(coordVal, true); if (isContiguous()) return findCoordElementIrregular(coordVal, true); else return findCoordElementNonContiguous(coordVal, true); }
/** * Given a coordinate position, find what grid element contains it. * This means that * <pre> * edge[i] <= pos < edge[i+1] (if values are ascending) * edge[i] > pos >= edge[i+1] (if values are descending) * </pre> * * @param coordVal position in this coordinate system * @return index of grid point containing it, or -1 if outside grid area */ public int findCoordElement(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElement() on non-numeric"); if (isRegular()) return findCoordElementRegular(coordVal, false); if (isContiguous()) return findCoordElementIrregular(coordVal, false); else return findCoordElementNonContiguous(coordVal, false); }
/** * Given a coordinate position, find what grid element contains it. * This means that * <pre> * edge[i] <= pos < edge[i+1] (if values are ascending) * edge[i] > pos >= edge[i+1] (if values are descending) * </pre> * * @param coordVal position in this coordinate system * @return index of grid point containing it, or -1 if outside grid area */ public int findCoordElement(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElement() on non-numeric"); if (isRegular()) return findCoordElementRegular(coordVal, false); if (isContiguous()) return findCoordElementIrregular(coordVal, false); else return findCoordElementNonContiguous(coordVal, false); }
/** * Given a coordinate value, find what grid element contains it. * This means that * <pre> * edge[i] <= value < edge[i+1] (if values are ascending) * edge[i] > value >= edge[i+1] (if values are descending) * </pre> * * @param coordVal position in this coordinate system * @return index of grid point containing it, or -1 if outside grid area */ public int findCoordElement(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElement() on non-numeric"); if (isRegular()) return findCoordElementRegular(coordVal, false); if (isContiguous()) return findCoordElementIrregular(coordVal, false); else return findCoordElementNonContiguous(coordVal, false); }
/** * Given a coordinate position, find what grid element contains it, or is closest to it. * * @param coordVal position in this coordinate system * @return index of grid point containing it, or best estimate of closest grid interval. */ public int findCoordElementBounded(double coordVal) { if (!isNumeric()) throw new UnsupportedOperationException("CoordinateAxis.findCoordElementBounded() on non-numeric"); // the scalar or len-1 case: if (this.getSize() == 1) return 0; if (isRegular()) return findCoordElementRegular(coordVal, true); if (isContiguous()) return findCoordElementIrregular(coordVal, true); else return findCoordElementNonContiguous(coordVal, true); }
/** * Sets the scale and offset coefficients in the given "grid to CRS" transform if possible. * This method is invoked only for variables that represent a coordinate system axis. */ @Override protected boolean trySetTransform(final Matrix gridToCRS, final int srcDim, final int tgtDim, final Vector values) throws IOException, DataStoreException { if (variable instanceof CoordinateAxis1D) { final CoordinateAxis1D axis = (CoordinateAxis1D) variable; if (axis.isRegular()) { gridToCRS.setElement(tgtDim, srcDim, axis.getIncrement()); gridToCRS.setElement(tgtDim, gridToCRS.getNumCol() - 1, axis.getStart()); return true; } } return super.trySetTransform(gridToCRS, srcDim, tgtDim, values); }