static void compare(FeatureDatasetPoint org, FeatureDatasetPoint copy) { FeatureType fcOrg = org.getFeatureType(); FeatureType fcCopy = copy.getFeatureType(); assert fcOrg == fcCopy; List<VariableSimpleIF> orgVars = org.getDataVariables(); List<VariableSimpleIF> copyVars = copy.getDataVariables(); Formatter f = new Formatter(); boolean ok = CompareNetcdf2.compareLists(getNames(orgVars, Lists.newArrayList("profileId")), getNames(copyVars, Lists.newArrayList("profileId")), f); if (ok) System.out.printf("Data Vars OK%n"); else { System.out.printf("Data Vars NOT OK%n %s%n", f); if (failOnDataVarsDifferent) assert false; } }
throw new FileNotFoundException("Collection dataset is not a FeatureDatasetPoint; spec=" + dcm); if (wantFeatureType == FeatureType.ANY_POINT) wantFeatureType = proto.getFeatureType();
throw new FileNotFoundException("Collection dataset is not a FeatureDatasetPoint; spec=" + dcm); if (wantFeatureType == FeatureType.ANY_POINT) wantFeatureType = proto.getFeatureType();
static public FeatureDataset factory(String location, FeatureType wantFeatureType, CollectionManager dcm, Formatter errlog) throws IOException { TimedCollection collection = new TimedCollection(dcm, errlog); if (collection.getDatasets().size() == 0) { throw new FileNotFoundException("Collection is empty; spec="+dcm); } if (wantFeatureType == FeatureType.ANY_POINT) { TimedCollection.Dataset d = collection.getPrototype(); FeatureDatasetPoint proto = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.ANY_POINT, d.getLocation(), null, errlog); wantFeatureType = proto.getFeatureType(); proto.close(); // LOOK - try to use } //LatLonRect bb = null; FeatureCollection fc = null; switch (wantFeatureType) { case POINT: CompositePointCollection pfc = new CompositePointCollection(dcm.getCollectionName(), collection); //bb = pfc.getBoundingBox(); fc = pfc; break; case STATION: CompositeStationCollection sfc = new CompositeStationCollection(dcm.getCollectionName(), collection, null, null); //bb = sfc.getBoundingBox(); fc = sfc; break; default: return null; } return new CompositePointDataset(location, wantFeatureType, fc, collection, null); }
rootElem.setAttribute("location", path); Element elem = new Element("featureDataset"); FeatureType ft = fdp.getFeatureType(); elem.setAttribute("type", ft.toString().toLowerCase()); String url = path.replace("dataset.xml", ft.toString().toLowerCase() + ".xml");
rootElem.setAttribute("location", path); Element elem = new Element("featureDataset"); elem.setAttribute("type", fdp.getFeatureType().toString().toLowerCase()); elem.setAttribute("url", path + "/" + fdp.getFeatureType().toString().toLowerCase()); rootElem.addContent(elem);
rootElem.setAttribute("location", path); Element elem = new Element("featureDataset"); FeatureType ft = fdp.getFeatureType(); elem.setAttribute("type", ft.toString().toLowerCase()); String url = path.replace("dataset.xml", ft.toString().toLowerCase() + ".xml");