@Override public boolean hasNext() throws IOException { if (localIterator == null) resetIteration(); return localIterator.hasNext(); }
public boolean hasNext() throws IOException { if (localIterator == null) resetIteration(); return localIterator.hasNext(); }
public boolean hasNext() throws IOException { if (localIterator == null) resetIteration(); return localIterator.hasNext(); }
private PointFeature nextFilteredDataPoint() throws IOException { if (pfiter == null) return null; if (!pfiter.hasNext()) return null; PointFeature pdata = pfiter.next(); if (filter == null) return pdata; while (!filter.filter(pdata)) { if (!pfiter.hasNext()) return null; pdata = pfiter.next(); } return pdata; }
private PointFeature nextFilteredDataPoint() throws IOException { if (pfiter == null) return null; if (!pfiter.hasNext()) return null; PointFeature pdata = pfiter.next(); if (filter == null) return pdata; while (!filter.filter(pdata)) { if (!pfiter.hasNext()) return null; pdata = pfiter.next(); } return pdata; }
private PointFeature nextFilteredDataPoint() throws IOException { if (pfiter == null) return null; if (!pfiter.hasNext()) return null; PointFeature pdata = pfiter.next(); if (filter == null) return pdata; while (!filter.filter(pdata)) { if (!pfiter.hasNext()) return null; pdata = pfiter.next(); } return pdata; }
/** * Returns the next point that satisfies the filter, or {@code null} if no such point exists. * * @return the next point that satisfies the filter, or {@code null} if no such point exists. */ private PointFeature nextFilteredDataPoint() { while (origIter.hasNext()) { PointFeature pointFeat = origIter.next(); if (filter.filter(pointFeat)) { return pointFeat; } } return null; }
public void addAll(FeatureDatasetPoint fdPoint) throws IOException { try (PointFeatureIterator pointFeatIter = new FlattenedDatasetPointCollection(fdPoint).getPointFeatureIterator()) { while (pointFeatIter.hasNext()) { StationPointFeature pointFeat = (StationPointFeature) pointFeatIter.next(); add(pointFeat); } } }
public static boolean equals(PointFeatureIterator iter1, PointFeatureIterator iter2) throws IOException { if (iter1 == iter2) { return true; } else if (iter1 == null || iter2 == null) { return false; } try { while (iter1.hasNext() && iter2.hasNext()) { if (!equals(iter1.next(), iter2.next())) { return false; } } return !(iter1.hasNext() || iter2.hasNext()); } finally { iter1.close(); iter2.close(); } }
public void calcBounds() throws java.io.IOException { if ((dateRange != null) && (boundingBox != null) && (size() > 0)) return; PointFeatureIterator iter = getPointFeatureIterator(-1); iter.setCalculateBounds(this); try { while (iter.hasNext()) iter.next(); } finally { iter.finish(); } }
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(); } } }
public void calcBounds() throws java.io.IOException { if ((dateRange != null) && (boundingBox != null) && (size() > 0)) return; PointFeatureIterator iter = getPointFeatureIterator(-1); iter.setCalculateBounds(this); try { while (iter.hasNext()) iter.next(); } finally { iter.finish(); } }
public boolean hasNext() throws IOException { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { finish(); return false; } } if (!pfIter.hasNext()) { pfIter.finish(); currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationCollectionFlattened.Iterator close dataset: %s%n", currentDataset.getLocation()); pfIter = getNextIterator(); return hasNext(); } return true; }
public boolean hasNext() throws IOException { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { finish(); return false; } } if (!pfIter.hasNext()) { pfIter.finish(); currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationFeatureIterator close dataset: %s%n", currentDataset.getLocation()); pfIter = getNextIterator(); return hasNext(); } return true; }
public boolean hasNext() throws IOException { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { finish(); return false; } } if (!pfIter.hasNext()) { pfIter.finish(); currentDataset.close(); pfIter = getNextIterator(); return hasNext(); } return true; }
@Test public void test2() throws IOException, NoFactoryFoundException, URISyntaxException { File testFile = new File(getClass().getResource("orthogonal.ncml").toURI()); Comparator<StationPointFeature> reverseStationNameComparator = Ordering.from(SortingStationPointFeatureCache.stationNameComparator).reverse(); SortingStationPointFeatureCache cache = new SortingStationPointFeatureCache(reverseStationNameComparator); cache.addAll(testFile); List<String> expectedStationNames = Arrays.asList("CCC", "BBB", "AAA"); List<String> actualStationNames = new LinkedList<>(); try (PointFeatureIterator iter = cache.getPointFeatureIterator()) { while (iter.hasNext()) { StationPointFeature stationPointFeat = (StationPointFeature) iter.next(); actualStationNames.add(stationPointFeat.getStation().getName()); } } Assert.assertEquals(expectedStationNames, actualStationNames); }
public boolean hasNext() throws IOException { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { finish(); return false; } } if (!pfIter.hasNext()) { pfIter.finish(); currentDataset.close(); pfIter = getNextIterator(); return hasNext(); } return true; }
public static void writeFeatureCollection(PointFeatureCollection pointFeatColl) throws IOException { PointFeatureIterator iter = pointFeatColl.getPointFeatureIterator(); while (iter.hasNext()) { PointFeature pointFeat = iter.next(); StructureData data = pointFeat.getFeatureData(); for (StructureMembers.Member member : data.getStructureMembers().getMembers()) { System.out.println(member.getName() + "\t\t" + data.getArray(member)); } System.out.println(); } }