private void copyFieldsFrom(DsgFeatureCollection featCol) { this.timeUnit = featCol.getTimeUnit(); this.altUnits = featCol.getAltUnits(); }
@Override public void calcBounds(java.util.Formatter sf) { for (DsgFeatureCollection pfc : collectionList) { try { CollectionInfo info = new DsgCollectionHelper(pfc).calcBounds(); sf.format(" bb = %s %n", info.bbox == null ? "" :info.bbox.toString2()); sf.format(" dates = %s %n", info.getCalendarDateRange(pfc.getTimeUnit())); } catch (IOException e) { e.printStackTrace(); } } }
@Override public void getDetailInfo(java.util.Formatter sf) { super.getDetailInfo(sf); int count = 0; for (DsgFeatureCollection pfc : collectionList) { sf.format("%nPointFeatureCollection %d %n", count); sf.format(" %s %s %n", pfc.getCollectionFeatureType(), pfc.getName()); sf.format(" npts = %d %n", pfc.size()); /* List<Variable> extra = pfc.getExtraVariables(); if (extra.size() > 0) { sf.format(" extra variables = "); for (Variable v : extra) sf.format("%s,", v.getNameAndDimensions()); sf.format("%n"); } */ sf.format(" timeUnit = %s %n", pfc.getTimeUnit()); sf.format(" altUnit = %s %n", pfc.getAltUnits()); count++; } }
StationPointFeatureCopy(StationFeature station, PointFeature pf) { super(pf.getFeatureCollection(), station, pf.getObservationTime(), pf.getNominalTime(), pf.getFeatureCollection().getTimeUnit()); this.station = station; }
PointFeatureCopy(PointFeature pf) { super(pf.getFeatureCollection(), pf.getLocation(), pf.getObservationTime(), pf.getNominalTime(), pf.getFeatureCollection().getTimeUnit()); }
static void checkDsgFeatureCollection( DsgFeatureCollection dsg) throws IOException { String what = dsg.getClass().getName(); Assert.assertNotNull(what + " name", dsg.getName()); Assert.assertNotNull(what + " featureTYpe", dsg.getCollectionFeatureType()); Assert.assertNotNull(what + " timeUnit", dsg.getTimeUnit()); // Assert.assertNotNull(what + " altUnits", dsg.getAltUnits()); // Assert.assertNotNull(what + " extraVars", dsg.getExtraVariables()); }
private CollectionInfo calcBounds(PointFeatureCollection pfc) { LatLonRect bbox = null; double minTime = Double.MAX_VALUE; double maxTime = -Double.MAX_VALUE; int count = 0; for (PointFeature pf : pfc) { if (bbox == null) bbox = new LatLonRect(pf.getLocation().getLatLon(), .001, .001); else bbox.extend(pf.getLocation().getLatLon()); double obsTime = pf.getObservationTime(); minTime = Math.min(minTime, obsTime); maxTime = Math.max(maxTime, obsTime); count++; } if (count == 0) { return new CollectionInfo(null, null, 0, 0); } CalendarDateUnit cdu = dsg.getTimeUnit(); CalendarDateRange dateRange = CalendarDateRange.of(cdu.makeCalendarDate(minTime), cdu.makeCalendarDate(maxTime)); return new CollectionInfo(bbox, dateRange, count, count); }
DsgFeatureCollection fc = list.get(0); // LOOK maybe should pass in the dsg? rootElem.addContent(writeTimeUnit(fc.getTimeUnit())); rootElem.addContent(new Element("AltitudeUnits").addContent(fc.getAltUnits()));