org.deegree.coverage.raster.utils
Class RasterBuilder

java.lang.Object
  extended by org.deegree.coverage.raster.utils.RasterBuilder
All Implemented Interfaces:
ExtendedResourceProvider<Coverage>, ResourceProvider, CoverageBuilder

public class RasterBuilder
extends Object
implements CoverageBuilder

The RasterBuilder recursively enters a given directory and creates a TiledRaster from found image files.

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Nested Class Summary
static class RasterBuilder.QTreeInfo
           
 
Constructor Summary
RasterBuilder()
           
 
Method Summary
 AbstractCoverage buildCoverage(File rasterLocation, boolean recursive, RasterIOOptions options)
          Creates a coverage from the given raster location.
 MultiResolutionRaster buildMultiResolutionRaster(File resolutionDirectory, boolean recursive, RasterIOOptions options)
          Create a MultiResolutionRaster with the origin or the world coordinate of each raster file, defined by the given RasterGeoReference.OriginLocation
 Coverage create(URL configUrl)
           
 String getConfigNamespace()
          Returns the namespace for configuration documents that this provider handles.
 URL getConfigSchema()
          Returns the URL for retrieving the configuration document schema.
 Class<? extends ResourceManager>[] getDependencies()
           
 void init(DeegreeWorkspace workspace)
          Will be called before any call to #create.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterBuilder

public RasterBuilder()
Method Detail

buildMultiResolutionRaster

public MultiResolutionRaster buildMultiResolutionRaster(File resolutionDirectory,
                                                        boolean recursive,
                                                        RasterIOOptions options)
Create a MultiResolutionRaster with the origin or the world coordinate of each raster file, defined by the given RasterGeoReference.OriginLocation

Parameters:
resolutionDirectory - locating the different resolutions
recursive - if the sub directories of the resolution directories should be scanned as well
options - containing information on the loading of the raster data.
Returns:
a MultiResolutionRaster filled with TiledRasters or null if the resolutionDirectory is not a directory.

getConfigNamespace

public String getConfigNamespace()
Description copied from interface: ResourceProvider
Returns the namespace for configuration documents that this provider handles.

Specified by:
getConfigNamespace in interface ResourceProvider
Returns:
the namespace for configuration documents, never null

buildCoverage

public AbstractCoverage buildCoverage(File rasterLocation,
                                      boolean recursive,
                                      RasterIOOptions options)
                               throws IOException
Creates a coverage from the given raster location. Supported are loading from:

Parameters:
rasterLocation - may be a raster file or a raster directory containing a tiled raster or several sub directories named with doubles, containing different resolutions (a multiresolution raster tree).
recursive - if the directory should be searched recursively.
options - containing configured values for the loading of the coverage.
Returns:
an AbstractCoverage created from the given raster location. Result can be a SimpleRaster a TiledRaster or a MultiResolutionRaster.
Throws:
IOException - if the raster location could not be read.

getConfigSchema

public URL getConfigSchema()
Description copied from interface: ResourceProvider
Returns the URL for retrieving the configuration document schema.

Specified by:
getConfigSchema in interface ResourceProvider
Returns:
the URL for retrieving the configuration document schema, may be null

init

public void init(DeegreeWorkspace workspace)
Description copied from interface: ExtendedResourceProvider
Will be called before any call to #create.

Specified by:
init in interface ExtendedResourceProvider<Coverage>

create

public Coverage create(URL configUrl)
                throws ResourceInitException
Specified by:
create in interface ExtendedResourceProvider<Coverage>
Returns:
a new resource created from the configuration url, never null
Throws:
ResourceInitException

getDependencies

public Class<? extends ResourceManager>[] getDependencies()
Specified by:
getDependencies in interface ExtendedResourceProvider<Coverage>
Returns:
dependencies as resource manager classes, never null


Copyright © 2011. All Rights Reserved.