public AxisType getAxisType() { return coordinateAxis.getAxisType(); }
@Override protected synchronized CoordinateReferenceSystem buildCoordinateReferenceSystem() { final AxisType axisType = coordinateAxis.getAxisType(); switch (axisType) { case GeoZ: case Height: case Pressure: String axisName = getName(); if (NetCDFCRSUtilities.VERTICAL_AXIS_NAMES.contains(axisName)) { return NetCDFCRSUtilities.buildVerticalCrs(coordinateAxis); } default: return null; } }
static String[] getUnitDirection(CoordinateAxis axis) { AxisType type = axis.getAxisType(); String units = axis.getUnitsString();
/** * @param binding * @param coordinateAxis */ public CoordinateVariable(Class<T> binding, CoordinateAxis coordinateAxis) { Utilities.ensureNonNull("coordinateAxis", coordinateAxis); Utilities.ensureNonNull("binding", binding); this.binding = binding; this.coordinateAxis = coordinateAxis; this.conversionFactor = 1d; AxisType axisType = coordinateAxis.getAxisType(); // Special management for projected coordinates with unit = km if ((axisType == AxisType.GeoX || axisType == AxisType.GeoY) && coordinateAxis.getUnitsString().equalsIgnoreCase("km")) { conversionFactor = KM_TO_M; convertAxis = true; } }
protected void init() { if (!coordinateAxis.isNumeric() || !(coordinateAxis instanceof CoordinateAxis1D) || (coordinateAxis.hasMissing() && !AxisType.Time.equals(coordinateAxis.getAxisType()))) { // Not sure time variable can have actual NoData values in the array. // Let's exclude it from GeneralHelper case. // We may revisit it if we find some data with FillValues in the array. axisHelper = new CoordinateAxisGeneralHelper(); } else { axisHelper = new CoordinateAxis1DNumericHelper(); } }
if (axisDimensions > 0 && axisDimensions < 3) { String axisName = axis.getFullName(); if (axis.getAxisType() != null) { coordinates.put(axisName, CoordinateVariable.create(axis)); } else {
public static Class<?> suggestBinding(CoordinateAxis coordinateAxis) { Utilities.ensureNonNull("coordinateAxis", coordinateAxis); final AxisType axisType = coordinateAxis.getAxisType();
Utilities.ensureNonNull("coordinateAxis", coordinateAxis); final AxisType axisType = coordinateAxis.getAxisType(); if (coordinateAxis.isNumeric()) {
AxisType axisType = zAxis.getAxisType();
try { if (timeAxis != null) { AxisType type = timeAxis.getAxisType(); String units = timeAxis.getUnitsString();
protected boolean hasXY(List<CoordinateAxis> coordAxes) { boolean hasX = false, hasY = false, hasLat = false, hasLon = false; for (CoordinateAxis axis : coordAxes) { AxisType axisType = axis.getAxisType(); if (axisType == AxisType.GeoX) hasX = true; if (axisType == AxisType.GeoY) hasY = true; if (axisType == AxisType.Lat) hasLat = true; if (axisType == AxisType.Lon) hasLon = true; } return (hasLat && hasLon) || (hasX && hasY); }
/** * Do we have an axes of the given type? * @param wantAxisType want this AxisType * @return true if we have at least one axis of that type. */ public boolean containsAxisType(AxisType wantAxisType) { for (CoordinateAxis ca : coordAxes) { if (ca.getAxisType() == wantAxisType) return true; } return false; }
/** * Do we have an axes of the given type? * @param wantAxisType want this AxisType * @return true if we have at least one axis of that type. */ public boolean containsAxisType(AxisType wantAxisType) { for (CoordinateAxis ca : coordAxes) { if (ca.getAxisType() == wantAxisType) return true; } return false; }
/** * Wraps the given coordinate system. */ Vertical(final CoordinateSystem cs, final CoordinateAxis netcdfAxis) { super(cs, Collections.singletonList(netcdfAxis)); switch (netcdfAxis.getAxisType()) { case Pressure: type = VerticalDatumType.BAROMETRIC; break; case Height: type = VerticalDatumType.GEOIDAL; break; case GeoZ: type = VerticalDatumType.valueOf("ELLIPSOIDAL"); break; default: type = VerticalDatumType.OTHER_SURFACE; break; } }
public int compare(CoordinateAxis o1, CoordinateAxis o2) { AxisType t1 = o1.getAxisType(); AxisType t2 = o2.getAxisType(); if (t1 != null && t2 != null) return t1.axisOrder() - t2.axisOrder(); return (t1 == null) ? ((t2 == null) ? 0 : -1) : 1; } });
public void showCoordAxes(java.util.Formatter sf) { sf.format("\nAxes\n"); for (CoordinateAxis axis : ds.getCoordinateAxes()) { sf.format(" %s %s\n", axis.getAxisType(), axis.getNameAndDimensions()); } }
private void dumpVariables(List<Variable> vars, PrintWriter out) { for (Variable v : vars) { out.print(" " + v.getFullName() + " " + v.getClass().getName()); // +" "+Integer.toHexString(v.hashCode())); if (v instanceof CoordinateAxis) out.println(" " + ((CoordinateAxis) v).getAxisType()); else out.println(); if (v instanceof Structure) dumpVariables(((Structure) v).getVariables(), out); } }
public int compare(CoordinateAxis c1, CoordinateAxis c2) { AxisType t1 = c1.getAxisType(); AxisType t2 = c2.getAxisType(); if ((t1 == null) && (t2 == null)) return c1.getShortName().compareTo(c2.getShortName()); if (t1 == null) return -1; if (t2 == null) return 1; return t1.axisOrder() - t2.axisOrder(); }
protected void setTimeUnits() throws Exception { List axes = ds.getCoordinateAxes(); for (int i = 0; i < axes.size(); i++) { CoordinateAxis axis = (CoordinateAxis) axes.get(i); if (axis.getAxisType() == AxisType.Time) { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); return; } } parseInfo.append("*** Time Units not Found\n"); }
protected void setTimeUnits() throws Exception { List axes = ds.getCoordinateAxes(); for (int i = 0; i < axes.size(); i++) { CoordinateAxis axis = (CoordinateAxis) axes.get(i); if (axis.getAxisType() == AxisType.Time) { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); return; } } parseInfo.append("*** Time Units not Found\n"); }