StandardProfileFeature(Station s, DateUnit timeUnit, String altUnits, double time, Cursor cursor, StructureData profileData) throws IOException { super(timeUnit.makeStandardDateString(time), timeUnit, altUnits, s.getLatitude(), s.getLongitude(), time, -1); this.cursor = cursor; this.profileData = profileData; if (Double.isNaN(time)) { // gotta read an obs to get the time try { PointFeatureIterator iter = getPointFeatureIterator(-1); if (iter.hasNext()) { PointFeature pf = iter.next(); this.time = pf.getObservationTime(); this.name = timeUnit.makeStandardDateString(this.time); } else { this.name = "empty"; } } catch (IOException e) { e.printStackTrace(); } } }
StandardProfileFeature(Station s, double time, Cursor cursor) throws IOException { super(timeUnit.makeStandardDateString(time), s.getLatitude(), s.getLongitude(), time, -1); this.cursor = cursor; if (Double.isNaN(time)) { // gotta read an obs to get the time try { PointFeatureIterator iter = getPointFeatureIterator(-1); if (iter.hasNext()) { PointFeature pf = iter.next(); this.time = pf.getObservationTime(); this.name = timeUnit.makeStandardDateString(this.time); } else { this.name = "empty"; } } catch (IOException e) { e.printStackTrace(); } } }
StandardProfileFeature(Station s, CalendarDateUnit timeUnit, String altUnits, double time, Cursor cursor, StructureData profileData) throws IOException { super(timeUnit.makeCalendarDate(time).toString(), timeUnit, altUnits, s.getLatitude(), s.getLongitude(), time, -1); this.cursor = cursor; this.profileData = profileData; if (Double.isNaN(time)) { // gotta read an obs to get the time try { PointFeatureIterator iter = getPointFeatureIterator(); if (iter.hasNext()) { PointFeature pf = iter.next(); this.time = pf.getObservationTime(); this.name = timeUnit.makeCalendarDate(this.time).toString(); } else { this.name = "empty"; } } catch (IOException e) { e.printStackTrace(); } } }