public boolean hasCoordinateSystem() { return ((VariableEnhanced) v).getCoordinateSystems().size() > 0; }
public boolean hasCoordinateSystem() { return ((VariableEnhanced) v).getCoordinateSystems().size() > 0; }
public boolean hasCoordinateSystem() { return ((VariableEnhanced) v).getCoordinateSystems().size() > 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); }
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 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 " "; }
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 " "; }
public GridCoordSys getGridCoordSys(VariableEnhanced ve) { List<CoordinateSystem> csList = ve.getCoordinateSystems(); for (CoordinateSystem cs : csList) { if (GridCoordSys.isGridCoordSys(null, cs, ve)) { return new GridCoordSys(cs, null); } } return null; }
public GridCoordSys getGridCoordSys(VariableEnhanced ve) { List<CoordinateSystem> csList = ve.getCoordinateSystems(); for (CoordinateSystem cs : csList) { if (GridCoordSys.isGridCoordSys(null, cs, ve)) { return new GridCoordSys(cs, null); } } return null; }
public GridCoordSys getGridCoordSys(VariableEnhanced ve) { List<CoordinateSystem> csList = ve.getCoordinateSystems(); for (CoordinateSystem cs : csList) { if (GridCoordSys.isGridCoordSys(null, cs, ve)) { return new GridCoordSys(cs, null); } } return null; }
public CoverageDatasetImpl(NetcdfDataset ds, Formatter parseInfo) { this.ds = ds; CoverageCSFactory fac = new CoverageCSFactory(); type = fac.classify(ds, parseInfo); coverageSets = new ArrayList<CoverageSet> (ds.getVariables().size()); for (CoordinateSystem cs : ds.getCoordinateSystems()) { CoverageCS ccs = CoverageCSFactory.make(ds, cs); if (ccs == null) continue; CoverageSet cset = new CoverageSetImpl(ccs); coverageSets.add(cset); } coverages = new ArrayList<Coverage> (ds.getVariables().size()); for (Variable v : ds.getVariables()) { VariableEnhanced ve = (VariableEnhanced) v; List<CoordinateSystem> css = ve.getCoordinateSystems(); if (css.size() == 0) continue; Collections.sort(css, new Comparator<CoordinateSystem>() { // take one with most axes public int compare(CoordinateSystem o1, CoordinateSystem o2) { return o2.getCoordinateAxes().size() - o1.getCoordinateAxes().size() ; } }); CoordinateSystem cs = css.get(0); CoverageSetImpl cset = findCoverageSet(cs); if (cset == null) continue; CoverageImpl ci = new CoverageImpl(ds, cset.ccs, ve); cset.coverages.add(ci); coverages.add(ci); } }
public CoverageDatasetImpl(NetcdfDataset ds, Formatter parseInfo) { this.ds = ds; CoverageCSFactory fac = new CoverageCSFactory(); type = fac.classify(ds, parseInfo); coverageSets = new ArrayList<> (ds.getVariables().size()); for (CoordinateSystem cs : ds.getCoordinateSystems()) { CoverageCS ccs = CoverageCSFactory.make(ds, cs); if (ccs == null) continue; CoverageSet cset = new CoverageSetImpl(ccs); coverageSets.add(cset); } coverages = new ArrayList<> (ds.getVariables().size()); for (Variable v : ds.getVariables()) { VariableEnhanced ve = (VariableEnhanced) v; List<CoordinateSystem> css = ve.getCoordinateSystems(); if (css.size() == 0) continue; Collections.sort(css, new Comparator<CoordinateSystem>() { // take one with most axes public int compare(CoordinateSystem o1, CoordinateSystem o2) { return o2.getCoordinateAxes().size() - o1.getCoordinateAxes().size() ; } }); CoordinateSystem cs = css.get(0); CoverageSetImpl cset = findCoverageSet(cs); if (cset == null) continue; CoverageImpl ci = new CoverageImpl(ds, cset.ccs, ve); cset.coverages.add(ci); coverages.add(ci); } }
List<CoordinateSystem> css = ve.getCoordinateSystems(); if (css.size() == 0) continue; Collections.sort(css, (o1, o2) -> o2.getCoordinateAxes().size() - o1.getCoordinateAxes().size());
ok &= checkAll(orgds.getFullName(), orgds.getCoordinateSystems(), copyds.getCoordinateSystems(), matches); for (int i = 0; i < matches.size(); i += 2) { CoordinateSystem orgCs = (CoordinateSystem) matches.get(i);
VariableEnhanced orge = (VariableEnhanced) org; VariableEnhanced copye = (VariableEnhanced) copy; ok &= checkAll(orge.getCoordinateSystems(), copye.getCoordinateSystems(), null);
private void constructCoordinateSystems(NetcdfDataset ds, VariableEnhanced v, Formatter parseInfo) { if (v instanceof StructureDS) { StructureDS s = (StructureDS) v; List<Variable> members = s.getVariables(); for (Variable nested : members) { // LOOK flatten here ?? constructCoordinateSystems(ds, (VariableEnhanced) nested, parseInfo); } } else { // see if it has a GridCS // LOOK: should add geogrid it multiple times if there are multiple geoCS ?? GridCoordSys gcs = null; List<CoordinateSystem> csys = v.getCoordinateSystems(); for (CoordinateSystem cs : csys) { GridCoordSys gcsTry = GridCoordSys.makeGridCoordSys(parseInfo, cs, v); if (gcsTry != null) { gcs = gcsTry; if (gcsTry.isProductSet()) break; } } if (gcs != null) addGeoGrid((VariableDS) v, gcs, parseInfo); } }
private void constructCoordinateSystems(NetcdfDataset ds, VariableEnhanced v, Formatter parseInfo) { if (v instanceof StructureDS) { StructureDS s = (StructureDS) v; List<Variable> members = s.getVariables(); for (Variable nested : members) { // LOOK flatten here ?? constructCoordinateSystems(ds, (VariableEnhanced) nested, parseInfo); } } else { // see if it has a GridCS // LOOK: should add geogrid it multiple times if there are multiple geoCS ?? GridCoordSys gcs = null; List<CoordinateSystem> csys = v.getCoordinateSystems(); for (CoordinateSystem cs : csys) { GridCoordSys gcsTry = GridCoordSys.makeGridCoordSys(parseInfo, cs, v); if (gcsTry != null) { gcs = gcsTry; if (gcsTry.isProductSet()) break; } } if (gcs != null) addGeoGrid((VariableDS) v, gcs, parseInfo); } }
private void constructCoordinateSystems(NetcdfDataset ds, VariableEnhanced v, Formatter parseInfo) { if (v instanceof StructureDS) { StructureDS s = (StructureDS) v; List<Variable> members = s.getVariables(); for (Variable nested : members) { // LOOK flatten here ?? constructCoordinateSystems(ds, (VariableEnhanced) nested, parseInfo); } } else { // see if it has a GridCS // LOOK: should add geogrid it multiple times if there are multiple geoCS ?? GridCoordSys gcs = null; List<CoordinateSystem> csys = v.getCoordinateSystems(); for (CoordinateSystem cs : csys) { GridCoordSys gcsTry = GridCoordSys.makeGridCoordSys(parseInfo, cs, v); if (gcsTry != null) { gcs = gcsTry; if (gcsTry.isProductSet()) break; } } if (gcs != null) addGeoGrid((VariableDS) v, gcs, parseInfo); } }