CoordinateSystemAdapter(CoordinateSystem cs) { this.cs = cs; // Check if the Vertical axis is present if (cs.hasVerticalAxis()) { vertical = true; } else { // Check if any of the unsupported dimensions is present Set<String> unsupported = NetCDFUtilities.getUnsupportedDimensions(); boolean present = false; for (String dimension : unsupported) { if (cs.containsAxis(dimension)) { present = true; break; } } if (present) { vertical = true; } else { vertical = false; } } }
CoordinateSystemAdapter(CoordinateSystem cs) { this.cs = cs; // Check if the Vertical axis is present if(cs.hasVerticalAxis()){ vertical = true; }else{ // Check if any of the unsupported dimensions is present Set<String> unsupported = UnidataUtilities.getUnsupportedDimensions(); boolean present = false; for(String dimension : unsupported){ if(cs.containsAxis(dimension)){ present = true; break; } } if(present){ vertical = true; }else{ vertical = false; } } }
CoordinateSystemAdapter(CoordinateSystem cs) { this.cs = cs; // Check if the Vertical axis is present if (cs.hasVerticalAxis()) { vertical = true; } else { // Check if any of the unsupported dimensions is present Set<String> unsupported = NetCDFUtilities.getUnsupportedDimensions(); boolean present = false; for (String dimension : unsupported) { if (cs.containsAxis(dimension)) { present = true; break; } } if (present) { vertical = true; } else { vertical = false; } } }
/** Return the zIndex-th value of the vertical dimension of the specified variable, as a double, or {@link Double#NaN} * in case that variable doesn't have a vertical axis. * * @param unidataReader the reader to be used for that search * @param variable the variable to be accessed * @param timeIndex the requested index * @param cs the coordinateSystem to be scan * @return * TODO move to variable wrapper */ private Number getVerticalValueByIndex(Variable variable, final int zIndex, final CoordinateSystem cs ) { double ve = Double.NaN; if (cs != null && cs.hasVerticalAxis()) { final int rank = variable.getRank(); final Dimension verticalDimension = variable.getDimension(rank - UnidataUtilities.Z_DIMENSION); return (Number) reader.coordinatesVariables.get(verticalDimension.getFullName()).read(zIndex); } return ve; }
/** Return the timeIndex-th value of the time dimension of the specified variable, as a Date, or null in case that * variable doesn't have a time axis. * * @param unidataReader the reader to be used for that search * @param variable the variable to be accessed * @param timeIndex the requested index * @param cs the coordinateSystem to be scan * @return * TODO move to variable wrapper */ private Date getTimeValueByIndex( Variable variable, int timeIndex, final CoordinateSystem cs ) { if (cs != null && cs.hasTimeAxis()) { final int rank = variable.getRank(); final Dimension temporalDimension = variable.getDimension(rank - ((cs.hasVerticalAxis() ? UnidataUtilities.Z_DIMENSION : 2) + 1)); return (Date) reader.coordinatesVariables.get(temporalDimension.getFullName()).read(timeIndex); } return null; }
final boolean hasVerticalAxis = coordinateSystem.hasVerticalAxis(); final SimpleFeatureType indexSchema = collection.getSchema(); final int bandDimension = rank - UnidataUtilities.Z_DIMENSION;