org.geotools.utils.imagemosaic
Class MosaicIndexBuilder

java.lang.Object
  extended by org.geotools.utils.progress.ProgressManager
      extended by org.geotools.utils.progress.BaseArgumentsManager
          extended by org.geotools.utils.imagemosaic.MosaicIndexBuilder
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, ProcessingEventListener

public class MosaicIndexBuilder
extends BaseArgumentsManager
implements java.lang.Runnable, ProcessingEventListener

This class is in responsible for creating the index for a mosaic of images that we want to tie together as a single coverage.

To get instructions on how to run the tool just run it without any argument and a nice and clean help message will be printed to the command line.

Anyway an example of a suitable list of argumentBuilder can be seen here below:

-s H:\\work\\data\\merano_aime -w *.tif -name merano -abs

where:

  1. -s H:\\work\\data\\merano_aime is the source directory
  2. -w *.tif is he wildcard for the files to process
  3. -name merano sets the name for the output shape
  4. -abs asks the tool to use absolute paths instead of relative

It is worth to point out that this tool comes as a command line tool but it has been built with GUI in mind . It has the capability to register ProcessingEventListener object that receive notifications about what is going on. Moreover it delegates all the computations to an external thread, hence we can stop the tool in the middle of processing with no so many concerns (hopefully :-) ).

Version:
0.3
Author:
Simone Giannecchini, GeoSolutions, Alessio Fabiani, GeoSolutions, Blaz Repnik

Nested Class Summary
 
Nested classes/interfaces inherited from class org.geotools.utils.progress.ProgressManager
ProgressManager.ProgressEventDispatchThreadEventLauncher
 
Field Summary
 
Fields inherited from class org.geotools.utils.progress.BaseArgumentsManager
argumentBuilder, DEFAULT_IMAGEIO_CACHING_BEHAVIOUR, DEFAULT_PRIORITY, DEFAULT_TILE_CACHE_SIZE, optionBuilder
 
Constructor Summary
MosaicIndexBuilder()
          Default constructor
 
Method Summary
 void exceptionOccurred(ExceptionEvent event)
           
 java.lang.String getIndexName()
           
 void getNotification(ProcessingEvent event)
          This method is repsonbile for sending the process progress events to the logger.
protected  double[] getResolution(GeneralEnvelope envelope, java.awt.geom.Rectangle2D dim, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          This method is responsible for computing the resolutions in for the provided grid geometry in the provided crs.
 double getResolutionX()
           
 double getResolutionY()
           
static void main(java.lang.String[] args)
          Entry point for the index builder.
 boolean parseArgs(java.lang.String[] args)
           
 void run()
          Main thread for the mosaic index builder.
 void setIndexName(java.lang.String indexName)
           
 void setLocationPath(java.lang.String locationPath)
           
 void setWildcardString(java.lang.String wildcardString)
           
 
Methods inherited from class org.geotools.utils.progress.BaseArgumentsManager
addOption, addOptions, finishInitialization, getOptionValue, getOptionValue, getPriority, getTileCacheSize, getToolName, getVersion, hasOption, hasOption, removeOption, removeOptions, setUseImageIOCache
 
Methods inherited from class org.geotools.utils.progress.ProgressManager
addProcessingEventListener, dispose, fireEvent, fireException, fireException, getStopThread, removeAllProcessingEventListeners, removeProcessingEventListener, stopThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MosaicIndexBuilder

public MosaicIndexBuilder()
Default constructor

Method Detail

run

public void run()
Main thread for the mosaic index builder.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class ProgressManager

main

public static void main(java.lang.String[] args)
Entry point for the index builder.

Parameters:
args -

parseArgs

public boolean parseArgs(java.lang.String[] args)
Overrides:
parseArgs in class BaseArgumentsManager

getResolution

protected final double[] getResolution(GeneralEnvelope envelope,
                                       java.awt.geom.Rectangle2D dim,
                                       org.opengis.referencing.crs.CoordinateReferenceSystem crs)
                                throws DataSourceException
This method is responsible for computing the resolutions in for the provided grid geometry in the provided crs.

It is worth to note that the returned resolution array is of length of 2 and it always is lon, lat for the moment.
It might be worth to remove the axes reordering code when we are confident enough with the code to handle the north-up crs.

TODO use orthodromic distance?

Parameters:
envelope - the GeneralEnvelope
dim -
crs -
Throws:
DataSourceException

getNotification

public void getNotification(ProcessingEvent event)
This method is repsonbile for sending the process progress events to the logger.

It should be used to do normal logging when running this tools as command line tools but it should be disable when putting the tool behind a GUI. In such a case the GUI should register itself as a ProcessingEventListener and consume the processing events.

Specified by:
getNotification in interface ProcessingEventListener
Parameters:
event - is a ProcessingEvent that informs the receiver on the precetnage of the progress as well as on what is happening.

exceptionOccurred

public void exceptionOccurred(ExceptionEvent event)
Specified by:
exceptionOccurred in interface ProcessingEventListener

setLocationPath

public final void setLocationPath(java.lang.String locationPath)
Parameters:
locationPath - the locationPath to set

setWildcardString

public final void setWildcardString(java.lang.String wildcardString)
Parameters:
wildcardString - the wildcardString to set

getIndexName

public java.lang.String getIndexName()

setIndexName

public void setIndexName(java.lang.String indexName)

getResolutionX

public double getResolutionX()

getResolutionY

public double getResolutionY()


Copyright © 1996-2010 Geotools. All Rights Reserved.