/** * Returns the coordinate system name. The default implementation delegates to * {@link CoordinateSystem#getName()}. * * @see CoordinateSystem#getName() */ @Override public String getCode() { return cs.getName(); }
/** * Returns a name for this grid geometry, for information purpose only. */ @Override public String getName() { return netcdfCS.getName(); }
@Override public String getName() { return cs.getName(); }
@Override public String getName() { return cs.getName(); }
/** * Retrieve the CoordinateSystem with the specified name. * * @param name String which identifies the desired CoordinateSystem * @return the CoordinateSystem, or null if not found */ public CoordinateSystem findCoordinateSystem(String name) { if (name == null) return null; for (CoordinateSystem v : coordSys) { if (name.equals(v.getName())) return v; } return null; }
/** * Retrieve the CoordinateSystem with the specified name. * * @param name String which identifies the desired CoordinateSystem * @return the CoordinateSystem, or null if not found */ public CoordinateSystem findCoordinateSystem(String name) { if (name == null) return null; for (CoordinateSystem v : coordSys) { if (name.equals(v.getName())) return v; } return null; }
/** * Retrieve the CoordinateSystem with the specified name. * * @param name String which identifies the desired CoordinateSystem * @return the CoordinateSystem, or null if not found */ public CoordinateSystem findCoordinateSystem(String name) { if (name == null) return null; for (CoordinateSystem v : coordSys) { if (name.equals(v.getName())) return v; } return null; }
private String getCoordSys( VariableEnhanced ve) { List csList = ve.getCoordinateSystems(); if (csList.size() == 1) { CoordinateSystem cs = (CoordinateSystem) csList.get(0); return cs.getName(); } else if (csList.size() > 1) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < csList.size(); i++) { CoordinateSystem cs = (CoordinateSystem) csList.get(i); if (i > 0) sb.append(";"); sb.append(cs.getName()); } return sb.toString(); } return " "; }
private String getCoordSys( VariableEnhanced ve) { List csList = ve.getCoordinateSystems(); if (csList.size() == 1) { CoordinateSystem cs = (CoordinateSystem) csList.get(0); return cs.getName(); } else if (csList.size() > 1) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < csList.size(); i++) { CoordinateSystem cs = (CoordinateSystem) csList.get(i); if (i > 0) sb.append(";"); sb.append(cs.getName()); } return sb.toString(); } return " "; }
/** Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = 17; result = 37*result + getName().hashCode(); result = 37*result + getCoordinateAxes().hashCode(); result = 37*result + getCoordinateTransforms().hashCode(); hashCode = result; } return hashCode; } private volatile int hashCode = 0;
/** Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = 17; result = 37*result + getName().hashCode(); result = 37*result + getCoordinateAxes().hashCode(); result = 37*result + getCoordinateTransforms().hashCode(); hashCode = result; } return hashCode; } private volatile int hashCode = 0;
public int compare(Object o1, Object o2) { VariableEnhanced v1 = (VariableEnhanced) o1; VariableEnhanced v2 = (VariableEnhanced) o2; List list1 = v1.getCoordinateSystems(); String cs1 = (list1.size() > 0) ? ((CoordinateSystem) list1.get(0)).getName() : ""; List list2 = v2.getCoordinateSystems(); String cs2 = (list2.size() > 0) ? ((CoordinateSystem) list2.get(0)).getName() : ""; if (cs2.equals(cs1)) return v1.getShortName().compareToIgnoreCase(v2.getShortName()); else return cs1.compareToIgnoreCase(cs2); }
public int compare(Object o1, Object o2) { VariableEnhanced v1 = (VariableEnhanced) o1; VariableEnhanced v2 = (VariableEnhanced) o2; List list1 = v1.getCoordinateSystems(); String cs1 = (list1.size() > 0) ? ((CoordinateSystem) list1.get(0)).getName() : ""; List list2 = v2.getCoordinateSystems(); String cs2 = (list2.size() > 0) ? ((CoordinateSystem) list2.get(0)).getName() : ""; if (cs2.equals(cs1)) return v1.getShortName().compareToIgnoreCase(v2.getShortName()); else return cs1.compareToIgnoreCase(cs2); }
/** Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = 17; result = 37*result + getName().hashCode(); result = 37*result + getCoordinateAxes().hashCode(); result = 37*result + getCoordinateTransforms().hashCode(); hashCode = result; } return hashCode; } private volatile int hashCode = 0;
public int compare(Object o1, Object o2) { VariableEnhanced v1 = (VariableEnhanced) o1; VariableEnhanced v2 = (VariableEnhanced) o2; List list1 = v1.getCoordinateSystems(); String cs1 = (list1.size() > 0) ? ((CoordinateSystem) list1.get(0)).getName() : ""; List list2 = v2.getCoordinateSystems(); String cs2 = (list2.size() > 0) ? ((CoordinateSystem) list2.get(0)).getName() : ""; if (cs2.equals(cs1)) return v1.getShortName().compareToIgnoreCase(v2.getShortName()); else return cs1.compareToIgnoreCase(cs2); }
private boolean compareCoordinateSystem(CoordinateSystem cs1, CoordinateSystem cs2, ObjFilter filter) { if (showCompare) f.format("compare CoordinateSystem '%s' to '%s' %n", cs1.getName(), cs2.getName()); List matchAxes = new ArrayList(); boolean ok = checkAll(cs1.getName(), cs1.getCoordinateAxes(), cs2.getCoordinateAxes(), matchAxes); for (int i = 0; i < matchAxes.size(); i += 2) { CoordinateAxis orgCs = (CoordinateAxis) matchAxes.get(i); CoordinateAxis copyCs = (CoordinateAxis) matchAxes.get(i + 1); ok &= compareCoordinateAxis(orgCs, copyCs, filter); } List matchTransforms = new ArrayList(); ok &= checkAll(cs1.getName(), cs1.getCoordinateTransforms(), cs2.getCoordinateTransforms(), matchTransforms); return ok; }
private CoverageSetImpl findCoverageSet( CoordinateSystem cs) { for (CoverageSet ccs : coverageSets) { if (ccs.getCoverageCS().getName().equals(cs.getName())) return (CoverageSetImpl) ccs; } return null; }
private boolean compareCoordinateSystem(CoordinateSystem cs1, CoordinateSystem cs2, ObjFilter filter) { if (showCompare) f.format("compare CoordinateSystem '%s' to '%s' %n", cs1.getName(), cs2.getName()); List matchAxes = new ArrayList(); boolean ok = checkAll(cs1.getName(), cs1.getCoordinateAxes(), cs2.getCoordinateAxes(), matchAxes); for (int i = 0; i < matchAxes.size(); i += 2) { CoordinateAxis orgCs = (CoordinateAxis) matchAxes.get(i); CoordinateAxis copyCs = (CoordinateAxis) matchAxes.get(i + 1); ok &= compareCoordinateAxis(orgCs, copyCs, filter); } List matchTransforms = new ArrayList(); ok &= checkAll(cs1.getName(), cs1.getCoordinateTransforms(), cs2.getCoordinateTransforms(), matchTransforms); return ok; }
private CoverageSetImpl findCoverageSet( CoordinateSystem cs) { for (CoverageSet ccs : coverageSets) { if (ccs.getCoverageCS().getName().equals(cs.getName())) return (CoverageSetImpl) ccs; } return null; }
private CoordinateSystem findReplacementCs(CoordinateSystem protoCs, String timeDim, NetcdfDataset result) { CoordinateSystem replace = result.findCoordinateSystem(protoCs.getName()); if (replace != null) return replace; List<CoordinateAxis> axes = new ArrayList<>(); for (CoordinateAxis axis : protoCs.getCoordinateAxes()) { CoordinateAxis ra = result.findCoordinateAxis(axis.getFullNameEscaped()); axes.add(ra); } // coord transforms are immutable and can be shared CoordinateSystem cs = new CoordinateSystem(result, axes, protoCs.getCoordinateTransforms()); result.addCoordinateSystem(cs); return cs; }