org.deegree_impl.model.cv
Class CVDescriptorFactory

java.lang.Object
  extended byorg.deegree_impl.model.cv.CVDescriptorFactory

public class CVDescriptorFactory
extends java.lang.Object

---------------------------------------------------------------------

Version:
$Id: CVDescriptorFactory.java,v 1.7 2004/02/23 07:47:50 poth Exp $
Author:
Andreas Poth

Nested Class Summary
private static class CVDescriptorFactory.CVFileFilter
           
private static class CVDescriptorFactory.CVFilenameFilter
           
 
Field Summary
static java.lang.String logFile
           
static boolean logToFile
           
private static java.lang.String NSCV
           
private static java.lang.String NSWCS
           
 
Constructor Summary
CVDescriptorFactory()
           
 
Method Summary
static CoverageLayer[] createCoverageLayer(org.w3c.dom.Element element)
          creates an array of CoverageLayers from the CoverageLayerList element of the capabilities TODO support for other layer types than grid coverages
static CVDescriptor createCVDescriptor(org.w3c.dom.Document document)
          create a CVDescriptor instance from an XML-document that's conform to CVDescriptor schema definition.
static CVDescriptor createCVDescriptor(java.net.URL resource)
          create a CVDescriptor instance from an URL referencing a XML- document that's conform to CVDescriptor schema definition.
private static ExtentType createExtent(org.w3c.dom.Element element)
          creates an ExtentType instance (without uom parameter)
private static Grid createGrid(org.w3c.dom.Element element)
          creates the Grid(description) of the GridCoverageLayer
private static GridAxisDescription createGridAxisDescription(org.w3c.dom.Element element)
          creates a description of a axis of the GridCoverageLayer
static GridCoverageLayer createGridCoverageLayer(org.w3c.dom.Element element)
          creates a GridCoverageLayer instance from a Element
private static GridExtentDescription createGridExtentDescription(org.w3c.dom.Element element)
          creates the GridExtentDescription for the GridCoverageLayer
private static GridRangeDescription[] createGridRangeDescription(org.w3c.dom.NodeList nl)
          creates the grid range description for GridCoverageLayers RangeSetDescription
private static GM_Envelope createLatLonBoundingBox(org.w3c.dom.Node node)
          creates the latlon bounding box of the GridCoverageLayer
private static Level createLevel(org.w3c.dom.Node node)
          creates a Level instance from a node of the CVDescriptor xml document.
private static java.net.URL[] createMetadataURLs(org.w3c.dom.NodeList list)
          creates a list URLs referencing metadata assigned to a GridCoverageLayer
private static CVRange createRange(org.w3c.dom.Element node)
          Creates a CVRange instance from a node of the CVDescriptor xml document.
private static RangeSetDescription createRangeSetDescription(org.w3c.dom.Element element)
          creates the range set description for the GridCoverageLayer
private static SpatialExtent createSpatialExtent(org.w3c.dom.Element element)
          creates an instance of a SpatialExtent
private static Format[] createSupportedFormatList(org.w3c.dom.NodeList list)
          creates a list of formats that are supported by the GridCoverageLayer
private static Tile[] createTiles(org.w3c.dom.Element[] elements)
          creates an array of Tile instances from an array of Tile-elements.
private static Tile[] createTilesFromDirectory(org.w3c.dom.Node node)
          creats an array of Tile instances from a node that represents a directory at the local or a remote file system
private static int getOrientation(java.lang.String s)
           
private static double[] worldFile(java.lang.String filename, int width, int height)
          Gets the bounding box of the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logToFile

public static boolean logToFile

logFile

public static java.lang.String logFile

NSWCS

private static java.lang.String NSWCS

NSCV

private static java.lang.String NSCV
Constructor Detail

CVDescriptorFactory

public CVDescriptorFactory()
Method Detail

createCVDescriptor

public static CVDescriptor createCVDescriptor(java.net.URL resource)
                                       throws java.io.IOException,
                                              org.xml.sax.SAXException,
                                              InvalidAxisDefinitionException
create a CVDescriptor instance from an URL referencing a XML- document that's conform to CVDescriptor schema definition.

Throws:
java.io.IOException
org.xml.sax.SAXException
InvalidAxisDefinitionException

createCVDescriptor

public static CVDescriptor createCVDescriptor(org.w3c.dom.Document document)
                                       throws java.io.IOException,
                                              InvalidAxisDefinitionException
create a CVDescriptor instance from an XML-document that's conform to CVDescriptor schema definition.

Throws:
java.io.IOException
InvalidAxisDefinitionException

createRange

private static CVRange createRange(org.w3c.dom.Element node)
                            throws java.io.IOException
Creates a CVRange instance from a node of the CVDescriptor xml document.

Throws:
java.io.IOException

createLevel

private static Level createLevel(org.w3c.dom.Node node)
                          throws java.io.IOException
creates a Level instance from a node of the CVDescriptor xml document.

Throws:
java.io.IOException

createTiles

private static Tile[] createTiles(org.w3c.dom.Element[] elements)
                           throws java.io.IOException
creates an array of Tile instances from an array of Tile-elements. Each element may represent one single Tile (file) or a set of Tiles using '*' as wild card for file (not directory) name

Throws:
java.io.IOException

createTilesFromDirectory

private static Tile[] createTilesFromDirectory(org.w3c.dom.Node node)
                                        throws java.io.IOException
creats an array of Tile instances from a node that represents a directory at the local or a remote file system

Throws:
java.io.IOException

worldFile

private static double[] worldFile(java.lang.String filename,
                                  int width,
                                  int height)
                           throws java.io.IOException
Gets the bounding box of the image.

Throws:
java.io.IOException

createCoverageLayer

public static CoverageLayer[] createCoverageLayer(org.w3c.dom.Element element)
                                           throws InvalidAxisDefinitionException,
                                                  java.net.MalformedURLException
creates an array of CoverageLayers from the CoverageLayerList element of the capabilities

TODO support for other layer types than grid coverages

Throws:
InvalidAxisDefinitionException
java.net.MalformedURLException

createGridCoverageLayer

public static GridCoverageLayer createGridCoverageLayer(org.w3c.dom.Element element)
                                                 throws InvalidAxisDefinitionException,
                                                        java.net.MalformedURLException
creates a GridCoverageLayer instance from a Element

Throws:
InvalidAxisDefinitionException
java.net.MalformedURLException

createMetadataURLs

private static java.net.URL[] createMetadataURLs(org.w3c.dom.NodeList list)
creates a list URLs referencing metadata assigned to a GridCoverageLayer


createLatLonBoundingBox

private static GM_Envelope createLatLonBoundingBox(org.w3c.dom.Node node)
creates the latlon bounding box of the GridCoverageLayer


createSupportedFormatList

private static Format[] createSupportedFormatList(org.w3c.dom.NodeList list)
creates a list of formats that are supported by the GridCoverageLayer


createGridExtentDescription

private static GridExtentDescription createGridExtentDescription(org.w3c.dom.Element element)
                                                          throws InvalidAxisDefinitionException
creates the GridExtentDescription for the GridCoverageLayer

Throws:
InvalidAxisDefinitionException

createSpatialExtent

private static SpatialExtent createSpatialExtent(org.w3c.dom.Element element)
creates an instance of a SpatialExtent


createExtent

private static ExtentType createExtent(org.w3c.dom.Element element)
creates an ExtentType instance (without uom parameter)


createGridAxisDescription

private static GridAxisDescription createGridAxisDescription(org.w3c.dom.Element element)
                                                      throws InvalidAxisDefinitionException
creates a description of a axis of the GridCoverageLayer

Throws:
InvalidAxisDefinitionException

getOrientation

private static int getOrientation(java.lang.String s)

createGrid

private static Grid createGrid(org.w3c.dom.Element element)
creates the Grid(description) of the GridCoverageLayer


createRangeSetDescription

private static RangeSetDescription createRangeSetDescription(org.w3c.dom.Element element)
creates the range set description for the GridCoverageLayer


createGridRangeDescription

private static GridRangeDescription[] createGridRangeDescription(org.w3c.dom.NodeList nl)
creates the grid range description for GridCoverageLayers RangeSetDescription