configuration.setParameter(Prop.ROOT_MOSAIC_DIR, new File(outputLocation, String.valueOf(level)).getAbsolutePath());
configuration.setParameter(Prop.INDEX_NAME, name);
configuration.setParameter(Prop.INDEXING_DIRECTORIES, configuration.getParameter(Prop.ROOT_MOSAIC_DIR));
// prepare and run the index builder
ImageMosaicEventHandlers eventHandler=new ImageMosaicEventHandlers();
final ImageMosaicConfigHandler catalogHandler = new ImageMosaicConfigHandler(configuration, eventHandler);
// TODO
final ImageMosaicDirectoryWalker builder = new ImageMosaicDirectoryWalker(catalogHandler, eventHandler);
builder.run();
eventHandler.addProcessingEventListener(new ImageMosaicEventHandlers.ProcessingEventListener() {
@Override
public void getNotification(
ImageMosaicEventHandlers.ProcessingEvent event) {
slaveToolsListener.getNotification(
new ProcessingEvent(
event.getSource(),
event.getMessage(),
event.getPercentage()));
}
@Override
public void exceptionOccurred(
ImageMosaicEventHandlers.ExceptionEvent event) {
slaveToolsListener.exceptionOccurred(new ExceptionEvent(event.getSource(),event.getMessage(),event.getPercentage(),event.getException()));
}
});
eventHandler.removeAllProcessingEventListeners();
MosaicConfigurationBean bean = catalogHandler.getConfigurations().values().iterator().next();
return new double[] { bean.getLevels()[0][0],bean.getLevels()[0][1]};
}