@Test public void testExecute() throws Exception { JAIExt.initJAIEXT(); final Landsat8BasicCommandLineOptions options = new Landsat8BasicCommandLineOptions(); options.setWorkspaceDir(Tests.WORKSPACE_DIR); options.setUseCachedScenes(true); options.setNBestScenes(1); options.setCqlFilter("BBOX(shape,-76.6,42.34,-76.4,42.54) and band='BQA'"); new AnalyzeRunner(options).runInternal(new ManualOperationParams()); final String outputStr = new String(output.toByteArray()); assertThat(outputStr, containsString("Acquisition Date: ")); assertThat(outputStr, containsString("Cloud Cover: ")); assertThat(outputStr, containsString("Scene Download URL: ")); assertThat(outputStr, containsString("<-- Totals -->")); assertThat(outputStr, containsString("Total Scenes: ")); assertThat(outputStr, containsString("Date Range: ")); assertThat(outputStr, containsString("Cloud Cover Range: ")); assertThat(outputStr, containsString("Average Cloud Cover: ")); assertThat(outputStr, containsString("WRS2 Paths/Rows covered: ")); assertThat(outputStr, containsString("Row Range: ")); assertThat(outputStr, containsString("Path Range: ")); assertThat(outputStr, containsString("Latitude Range: ")); assertThat(outputStr, containsString("Longitude Range: ")); assertThat(outputStr, containsString("Band BQA: ")); }
protected void runInternal(final OperationParams params) throws Exception { try { try (BandFeatureIterator bands = new BandFeatureIterator( landsatOptions.isOnlyScenesSinceLastRun(), landsatOptions.isUseCachedScenes(), landsatOptions.isNBestPerSpatial(), landsatOptions.getNBestScenes(), landsatOptions.getNBestBands(), landsatOptions.getCqlFilter(), landsatOptions.getWorkspaceDir())) { final AnalysisInfo info = new AnalysisInfo(); String prevEntityId = null; while (bands.hasNext()) { final SimpleFeature band = bands.next(); final String entityId = (String) band.getAttribute(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME); if ((prevEntityId == null) || !prevEntityId.equals(entityId)) { prevEntityId = entityId; nextScene(band, info); } nextBand(band, info); } lastSceneComplete(info); } } catch (final IOException e) { LOGGER.error("", e); } }
AnalyzeRunner { protected void runInternal(final OperationParams params) throws Exception { try { try (BandFeatureIterator bands = new BandFeatureIterator( landsatOptions.isOnlyScenesSinceLastRun(), landsatOptions.isUseCachedScenes(), landsatOptions.isNBestPerSpatial(), landsatOptions.getNBestScenes(), landsatOptions.getNBestBands(), landsatOptions.getCqlFilter(), landsatOptions.getWorkspaceDir())) { final AnalysisInfo info = new AnalysisInfo(); String prevEntityId = null; while (bands.hasNext()) { final SimpleFeature band = bands.next(); final String entityId = (String) band.getAttribute(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME); if ((prevEntityId == null) || !prevEntityId.equals(entityId)) { prevEntityId = entityId; nextScene(band, info); } nextBand(band, info); } lastSceneComplete(info); } } catch (final IOException e) { LOGGER.error("", e); } } }
AnalyzeRunner { protected void runInternal(final OperationParams params) throws Exception { try { try (BandFeatureIterator bands = new BandFeatureIterator( landsatOptions.isOnlyScenesSinceLastRun(), landsatOptions.isUseCachedScenes(), landsatOptions.isNBestPerSpatial(), landsatOptions.getNBestScenes(), landsatOptions.getNBestBands(), landsatOptions.getCqlFilter(), landsatOptions.getWorkspaceDir())) { final AnalysisInfo info = new AnalysisInfo(); String prevEntityId = null; while (bands.hasNext()) { final SimpleFeature band = bands.next(); final String entityId = (String) band.getAttribute(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME); if ((prevEntityId == null) || !prevEntityId.equals(entityId)) { prevEntityId = entityId; nextScene(band, info); } nextBand(band, info); } lastSceneComplete(info); } } catch (final IOException e) { LOGGER.error("", e); } } AnalyzeRunner(final Landsat8BasicCommandLineOptions landsatOptions); }
AnalyzeRunner { protected void runInternal(final OperationParams params) throws Exception { try { try (BandFeatureIterator bands = new BandFeatureIterator( landsatOptions.isOnlyScenesSinceLastRun(), landsatOptions.isUseCachedScenes(), landsatOptions.isNBestPerSpatial(), landsatOptions.getNBestScenes(), landsatOptions.getNBestBands(), landsatOptions.getCqlFilter(), landsatOptions.getWorkspaceDir())) { final AnalysisInfo info = new AnalysisInfo(); String prevEntityId = null; while (bands.hasNext()) { final SimpleFeature band = bands.next(); final String entityId = (String) band.getAttribute(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME); if ((prevEntityId == null) || !prevEntityId.equals(entityId)) { prevEntityId = entityId; nextScene(band, info); } nextBand(band, info); } lastSceneComplete(info); } } catch (final IOException e) { LOGGER.error("", e); } } AnalyzeRunner(final Landsat8BasicCommandLineOptions landsatOptions);  }
AnalyzeRunner { protected void runInternal(final OperationParams params) throws Exception { try { try (BandFeatureIterator bands = new BandFeatureIterator( landsatOptions.isOnlyScenesSinceLastRun(), landsatOptions.isUseCachedScenes(), landsatOptions.isNBestPerSpatial(), landsatOptions.getNBestScenes(), landsatOptions.getNBestBands(), landsatOptions.getCqlFilter(), landsatOptions.getWorkspaceDir())) { final AnalysisInfo info = new AnalysisInfo(); String prevEntityId = null; while (bands.hasNext()) { final SimpleFeature band = bands.next(); final String entityId = (String) band.getAttribute(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME); if ((prevEntityId == null) || !prevEntityId.equals(entityId)) { prevEntityId = entityId; nextScene(band, info); } nextBand(band, info); } lastSceneComplete(info); } } catch (final IOException e) { LOGGER.error("", e); } } AnalyzeRunner(final Landsat8BasicCommandLineOptions landsatOptions);   }