@Override public List<CoordinateTransform> getCoordinateTransforms() { return cs.getCoordinateTransforms(); }
@Override public List<CoordinateTransform> getCoordinateTransforms() { return cs.getCoordinateTransforms(); }
/** 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;
/** 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;
/** * Instances which have same name are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if ( !(oo instanceof CoordinateSystem)) return false; CoordinateSystem o = (CoordinateSystem) oo; if (!getName().equals(o.getName())) return false; List<CoordinateAxis> oaxes = o.getCoordinateAxes(); for (CoordinateAxis axis : getCoordinateAxes()) { if (!oaxes.contains(axis)) return false; } List<CoordinateTransform> otrans = o.getCoordinateTransforms(); for (CoordinateTransform tran : getCoordinateTransforms()) { if (!otrans.contains(tran)) return false; } return true; }
/** * Instances which have same name are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if ( !(oo instanceof CoordinateSystem)) return false; CoordinateSystem o = (CoordinateSystem) oo; if (!getName().equals(o.getName())) return false; List<CoordinateAxis> oaxes = o.getCoordinateAxes(); for (CoordinateAxis axis : getCoordinateAxes()) { if (!oaxes.contains(axis)) return false; } List<CoordinateTransform> otrans = o.getCoordinateTransforms(); for (CoordinateTransform tran : getCoordinateTransforms()) { if (!otrans.contains(tran)) return false; } return true; }
/** * Instances which have same name are equal. */ public boolean equals(Object oo) { if (this == oo) return true; if ( !(oo instanceof CoordinateSystem)) return false; CoordinateSystem o = (CoordinateSystem) oo; if (!getName().equals(o.getName())) return false; List<CoordinateAxis> oaxes = o.getCoordinateAxes(); for (CoordinateAxis axis : getCoordinateAxes()) { if (!oaxes.contains(axis)) return false; } List<CoordinateTransform> otrans = o.getCoordinateTransforms(); for (CoordinateTransform tran : getCoordinateTransforms()) { if (!otrans.contains(tran)) return false; } return true; }
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 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 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; }
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<CoordinateAxis>(); for (CoordinateAxis axis : protoCs.getCoordinateAxes()) { Variable v = result.findCoordinateAxis(axis.getFullNameEscaped()); CoordinateAxis ra; if (v instanceof CoordinateAxis) ra = (CoordinateAxis) v; else { // if not a CoordinateAxis, will turn into one ra = result.addCoordinateAxis((VariableDS) v); if (axis.getAxisType() != null) { ra.setAxisType(axis.getAxisType()); ra.addAttribute(new Attribute(_Coordinate.AxisType, axis.getAxisType().toString())); } } axes.add(ra); } // coord transforms are immutable and can be shared CoordinateSystem cs = new CoordinateSystem(result, axes, protoCs.getCoordinateTransforms()); result.addCoordinateSystem(cs); return cs; }
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<CoordinateAxis>(); for (CoordinateAxis axis : protoCs.getCoordinateAxes()) { Variable v = result.findCoordinateAxis(axis.getFullNameEscaped()); CoordinateAxis ra; if (v instanceof CoordinateAxis) ra = (CoordinateAxis) v; else { // if not a CoordinateAxis, will turn into one ra = result.addCoordinateAxis((VariableDS) v); if (axis.getAxisType() != null) { ra.setAxisType(axis.getAxisType()); ra.addAttribute(new Attribute(_Coordinate.AxisType, axis.getAxisType().toString())); } } axes.add(ra); } // coord transforms are immutable and can be shared CoordinateSystem cs = new CoordinateSystem(result, axes, protoCs.getCoordinateTransforms()); result.addCoordinateSystem(cs); return cs; }
List<CoordinateTransform> tList = csys.getCoordinateTransforms(); assert tList != null; for (CoordinateTransform ct : tList) {
private Element makeCoordSys( CoordinateSystem cs) { Element csElem = new Element("coordinateSystem", ncNS); csElem.setAttribute("name", cs.getName()); for (CoordinateAxis axis : cs.getCoordinateAxes()) { Element axisElem = new Element("coordinateAxisRef", ncNS); axisElem.setAttribute("ref", axis.getFullName()); csElem.addContent(axisElem); } List<CoordinateTransform> transforms = cs.getCoordinateTransforms(); if (transforms != null) for (CoordinateTransform ct : transforms) { if (ct == null) continue; Element tElem = new Element("coordinateTransformRef", ncNS); tElem.setAttribute("ref", ct.getName()); csElem.addContent(tElem); } return csElem; }
private Element makeCoordSys( CoordinateSystem cs) { Element csElem = new Element("coordinateSystem", ncNS); csElem.setAttribute("name", cs.getName()); for (CoordinateAxis axis : cs.getCoordinateAxes()) { Element axisElem = new Element("coordinateAxisRef", ncNS); axisElem.setAttribute("ref", axis.getFullName()); csElem.addContent(axisElem); } List<CoordinateTransform> transforms = cs.getCoordinateTransforms(); if (transforms != null) for (CoordinateTransform ct : transforms) { if (ct == null) continue; Element tElem = new Element("coordinateTransformRef", ncNS); tElem.setAttribute("ref", ct.getName()); csElem.addContent(tElem); } return csElem; }
private Element makeCoordSys( CoordinateSystem cs) { Element csElem = new Element("coordinateSystem", thredds.client.catalog.Catalog.ncmlNS); csElem.setAttribute("name", cs.getName()); for (CoordinateAxis axis : cs.getCoordinateAxes()) { Element axisElem = new Element("coordinateAxisRef", thredds.client.catalog.Catalog.ncmlNS); axisElem.setAttribute("ref", axis.getFullName()); csElem.addContent(axisElem); } List<CoordinateTransform> transforms = cs.getCoordinateTransforms(); if (transforms != null) for (CoordinateTransform ct : transforms) { if (ct == null) continue; Element tElem = new Element("coordinateTransformRef", thredds.client.catalog.Catalog.ncmlNS); tElem.setAttribute("ref", ct.getName()); csElem.addContent(tElem); } return csElem; }
for (CoordinateTransform ct : csys.getCoordinateTransforms()) { if (ct.getTransformType() == TransformType.Vertical) vList.add(ct);
List<CoordinateTransform> ctList = cs.getCoordinateTransforms(); if (ctList != null) { for (CoordinateTransform ct : ctList) {
List<CoordinateTransform> coordTransforms = cs.getCoordinateTransforms(); for (CoordinateTransform ct : coordTransforms) { Element ctElem = new Element("coordTransform");