@Test public void testHarvestMultipleFilesWithoutCRS() throws Exception { MultipleHarvestSetup multipleHarvestSetup = new MultipleHarvestSetup().invoke(); Collection<File> files = multipleHarvestSetup.getFiles(); ImageMosaicReader tempReader = multipleHarvestSetup.getReader(); File directory = URLs.urlToFile((URL) tempReader.getSource()); tempReader.dispose(); File config = new File(directory, directory.getName() + ".properties"); Properties p = new Properties(); try (FileInputStream fis = new FileInputStream(config)) { p.load(fis); } p.remove(Prop.MOSAIC_CRS); try (FileOutputStream fos = new FileOutputStream(config)) { p.store(fos, null); } ImageMosaicReader reader = multipleHarvestSetup.getReader(); GranuleCatalog originalCatalog = reader.granuleCatalog; try { assertMultipleFileHarvest(files, reader, originalCatalog); } finally { reader.dispose(); } }
@Override public synchronized void dispose() { super.dispose(); synchronized (this) { try { if (granuleCatalog != null) this.granuleCatalog.dispose(); disposeManagers(); } catch (Exception e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } }
ImageMosaicReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader { @Override public synchronized void dispose() { super.dispose(); synchronized (this) { try { if (granuleCatalog != null) this.granuleCatalog.dispose(); disposeManagers(); } catch (Exception e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } } }
ImageMosaicReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader { @Override public synchronized void dispose() { super.dispose(); synchronized (this) { try { if (granuleCatalog != null) this.granuleCatalog.dispose(); disposeManagers(); } catch (Exception e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } } ImageMosaicReader(Object source, Hints uHints);  ImageMosaicReader(Object source); }
ImageMosaicReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader { @Override public synchronized void dispose() { super.dispose(); synchronized (this) { try { if (granuleCatalog != null) this.granuleCatalog.dispose(); disposeManagers(); } catch (Exception e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } } ImageMosaicReader(Object source, Hints uHints);  ImageMosaicReader(Object source); RasterManager getRasterManager(String name); @Override String[] getGridCoverageNames(); Format getFormat(); GridCoverage2D read(GeneralParameterValue[] params); GridCoverage2D read(String coverageName, GeneralParameterValue[] params); @Override int getGridCoverageCount(); @Override synchronized void dispose(); @Override String[] getMetadataNames(); @Override String[] getMetadataNames(String coverageName); @Override String getMetadataValue(final String name); @Override String getMetadataValue(String coverageName, final String name); @Override Set<ParameterDescriptor<List>> getDynamicParameters(); @Override Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName); boolean isParameterSupported(Identifier name); @Override double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution); @Override double[] getReadingResolutions(
            String coverageName, OverviewPolicy policy, double[] requestedResolution); boolean isParameterSupported(String coverageName, Identifier parameterName); @Override GranuleSource getGranules(String coverageName, final boolean readOnly); @Override boolean isReadOnly(); @Override void createCoverage(String coverageName, SimpleFeatureType indexSchema); @Override boolean removeCoverage(String coverageName, final boolean delete); @Override GeneralEnvelope getOriginalEnvelope(); @Override GeneralEnvelope getOriginalEnvelope(String coverageName); @Override GridEnvelope getOriginalGridRange(); @Override GridEnvelope getOriginalGridRange(String coverageName); @Override MathTransform getOriginalGridToWorld(PixelInCell pixInCell); @Override MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell); @Override CoordinateReferenceSystem getCoordinateReferenceSystem(); @Override CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName); @Override ImageLayout getImageLayout(); @Override ImageLayout getImageLayout(String coverageName); @Override double[][] getResolutionLevels(); @Override double[][] getResolutionLevels(String coverageName); @Override List<HarvestedSource> harvest(String defaultCoverage, Object source, Hints hints); @Override List<DimensionDescriptor> getDimensionDescriptors(String coverageName); @Override synchronized void delete(boolean deleteData); @Override ResourceInfo getInfo(String coverageName); @Override ServiceInfo getInfo(); ExecutorService getMultiThreadedLoader(); DatasetLayout getDatasetLayout(); }
ImageMosaicReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader { @Override public synchronized void dispose() { super.dispose(); synchronized (this) { try { if (granuleCatalog != null) this.granuleCatalog.dispose(); disposeManagers(); } catch (Exception e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } } ImageMosaicReader(Object source, Hints uHints);  ImageMosaicReader(Object source); RasterManager getRasterManager(String name); @Override String[] getGridCoverageNames(); Format getFormat(); GridCoverage2D read(GeneralParameterValue[] params); GridCoverage2D read(String coverageName, GeneralParameterValue[] params); @Override int getGridCoverageCount(); @Override synchronized void dispose(); @Override String[] getMetadataNames(); @Override String[] getMetadataNames(String coverageName); @Override String getMetadataValue(final String name); @Override String getMetadataValue(String coverageName, final String name); @Override Set<ParameterDescriptor<List>> getDynamicParameters(); @Override Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName); boolean isParameterSupported(Identifier name); @Override double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution); @Override double[] getReadingResolutions(
            String coverageName, OverviewPolicy policy, double[] requestedResolution); boolean isParameterSupported(String coverageName, Identifier parameterName); @Override GranuleSource getGranules(String coverageName, final boolean readOnly); @Override boolean isReadOnly(); @Override void createCoverage(String coverageName, SimpleFeatureType indexSchema); @Override boolean removeCoverage(String coverageName, final boolean delete); @Override GeneralEnvelope getOriginalEnvelope(); @Override GeneralEnvelope getOriginalEnvelope(String coverageName); @Override GridEnvelope getOriginalGridRange(); @Override GridEnvelope getOriginalGridRange(String coverageName); @Override MathTransform getOriginalGridToWorld(PixelInCell pixInCell); @Override MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell); @Override CoordinateReferenceSystem getCoordinateReferenceSystem(); @Override CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName); @Override ImageLayout getImageLayout(); @Override ImageLayout getImageLayout(String coverageName); @Override double[][] getResolutionLevels(); @Override double[][] getResolutionLevels(String coverageName); @Override List<HarvestedSource> harvest(String defaultCoverage, Object source, Hints hints); @Override List<DimensionDescriptor> getDimensionDescriptors(String coverageName); @Override synchronized void delete(boolean deleteData); @Override ResourceInfo getInfo(String coverageName); @Override ServiceInfo getInfo(); ExecutorService getMultiThreadedLoader(); DatasetLayout getDatasetLayout(); static final String UNSPECIFIED; }