public static void writeConfigXML(FeatureDatasetPoint pfd, java.util.Formatter f) { if (!(pfd instanceof PointDatasetStandardFactory.PointDatasetStandard)) { f.format("%s not instance of PointDatasetStandard%n", pfd.getLocation()); return; } PointDatasetStandardFactory.PointDatasetStandard spfd = (PointDatasetStandardFactory.PointDatasetStandard) pfd; TableAnalyzer analyser = spfd.getTableAnalyzer(); TableConfig config = analyser.getTableConfig(); TableConfigurer tc = analyser.getTableConfigurer(); if (tc == null) { f.format("%s has no TableConfig%n", pfd.getLocation()); return; } PointConfigXML writer = new PointConfigXML(); try { writer.writeConfigXML(config, tc.getClass().getName(), f); } catch (IOException e) { f.format("%s error writing=%s%n", pfd.getLocation(), e.getMessage()); } }
public static void writeConfigXML(FeatureDatasetPoint pfd, java.util.Formatter f) { if (!(pfd instanceof PointDatasetStandardFactory.PointDatasetStandard)) { f.format("%s not instance of PointDatasetStandard%n", pfd.getLocation()); return; } PointDatasetStandardFactory.PointDatasetStandard spfd = (PointDatasetStandardFactory.PointDatasetStandard) pfd; TableAnalyzer analyser = spfd.getTableAnalyzer(); TableConfig config = analyser.getTableConfig(); TableConfigurer tc = analyser.getTableConfigurer(); if (tc == null) { f.format("%s has no TableConfig%n", pfd.getLocation()); return; } PointConfigXML writer = new PointConfigXML(); try { writer.writeConfigXML(config, tc.getClass().getName(), f); } catch (IOException e) { f.format("%s error writing=%s%n", pfd.getLocation(), e.getMessage()); } }
public static void writeConfigXML(FeatureDatasetPoint pfd, java.util.Formatter f) { if (!(pfd instanceof PointDatasetStandardFactory.PointDatasetStandard)) { f.format("%s not instance of PointDatasetStandard%n", pfd.getLocation()); return; } PointDatasetStandardFactory.PointDatasetStandard spfd = (PointDatasetStandardFactory.PointDatasetStandard) pfd; TableAnalyzer analyser = spfd.getTableAnalyzer(); TableConfig config = analyser.getTableConfig(); TableConfigurer tc = analyser.getTableConfigurer(); if (tc == null) { f.format("%s has no TableConfig%n", pfd.getLocation()); return; } PointConfigXML writer = new PointConfigXML(); try { writer.writeConfigXML(config, tc.getClass().getName(), f); } catch (IOException e) { f.format("%s error writing=%s%n", pfd.getLocation(), e.getMessage()); return; } }
/** * Constructs a FlattenedDatasetPointCollection. * * @param fdPoint a point dataset. * @throws IllegalArgumentException if any of the feature collections in the dataset are not of type * {@code PointFeatureCollection} or {@code NestedPointFeatureCollection}. */ public FlattenedDatasetPointCollection(FeatureDatasetPoint fdPoint) throws IllegalArgumentException { super(fdPoint.getLocation(), CalendarDateUnit.unixDateUnit, null); // Default dateUnit and altUnits. this.fdPoint = fdPoint; List<DsgFeatureCollection> featCols = fdPoint.getPointFeatureCollectionList(); if (!featCols.isEmpty()) { DsgFeatureCollection firstFeatCol = featCols.get(0); // Replace this.dateUnit, this.altUnits, and this.extras with "typical" values from firstFeatCol. // We can't be certain that those values are representative of ALL collections in the dataset, but it's // a decent bet because in practice, firstFeatCol is so often the ONLY collection. copyFieldsFrom(firstFeatCol); } }
@Override public void close() { if (finished) return; if (pfIter != null) pfIter.close(); finishCalcBounds(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationCollectionFlattened close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finished = true; } }
public void finish() { if (finished) return; if (pfIter != null) pfIter.finish(); finishCalcBounds(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationCollectionFlattened close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finished = true; }
public void finish() { if (finished) return; if (pfIter != null) pfIter.finish(); finishCalcBounds(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationCollectionFlattened close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finished = true; }
public void finish() { if (finished) return; if (pfIter != null) pfIter.finish(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationFeatureIterator close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finishCalcBounds(); finished = true; //if (CompositeStationFeature.this.npts < 0) // LOOK needed ? // CompositeStationFeature.this.npts = getCount(); }
public void finish() { if (finished) return; if (pfIter != null) pfIter.finish(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationFeatureIterator close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finishCalcBounds(); finished = true; //if (CompositeStationFeature.this.npts < 0) // LOOK needed ? // CompositeStationFeature.this.npts = getCount(); }
@Override public void close() { if (finished) return; if (pfIter != null) pfIter.close(); if (currentDataset != null) try { currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationFeatureIterator close dataset: %s%n", currentDataset.getLocation()); } catch (IOException e) { throw new RuntimeException(e); } finishCalcBounds(); finished = true; } }
FeatureDatasetPoint rewriteDataset(FeatureDatasetPoint fdpoint, String prefix, CFPointWriterConfig config) throws IOException { String location = fdpoint.getLocation(); if (location.startsWith("file:")) location = location.substring(5); File fileIn = new File(location);
@Override public boolean hasNext() { try { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { close(); return false; } } if (!pfIter.hasNext()) { pfIter.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositePointFeatureIterator open dataset %s%n", currentDataset.getLocation()); currentDataset.close(); pfIter = getNextIterator(); return hasNext(); } return true; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override public boolean hasNext() { try { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { close(); return false; } } if (!pfIter.hasNext()) { pfIter.close(); currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationCollectionFlattened.Iterator close dataset: %s%n", currentDataset.getLocation()); pfIter = getNextIterator(); return hasNext(); } return true; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override public boolean hasNext() { try { if (pfIter == null) { pfIter = getNextIterator(); if (pfIter == null) { close(); return false; } } if (!pfIter.hasNext()) { pfIter.close(); currentDataset.close(); if (CompositeDatasetFactory.debug) System.out.printf("CompositeStationFeatureIterator close dataset: %s%n", currentDataset.getLocation()); pfIter = getNextIterator(); return hasNext(); } return true; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
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(); if (CompositeDatasetFactory.debug) System.out.printf("CompositePointFeatureIterator open dataset %s%n", currentDataset.getLocation()); currentDataset.close(); 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(); 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(); 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(); if (CompositeDatasetFactory.debug) System.out.printf("CompositePointFeatureIterator open dataset %s%n", currentDataset.getLocation()); currentDataset.close(); pfIter = getNextIterator(); return hasNext(); } return true; }