deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.ogcwebservices.wpvs.utils
Class ResolutionStripe

java.lang.Object
  extended by org.deegree.ogcwebservices.wpvs.utils.ResolutionStripe
All Implemented Interfaces:
Comparable<ResolutionStripe>, Callable<ResolutionStripe>

public class ResolutionStripe
extends Object
implements Callable<ResolutionStripe>, Comparable<ResolutionStripe>

The ResolutionStripe class encapsulates a Surface with a maximum Resolution, which is convenient for the creation of a quadtree.

Version:
$Revision: 20595 $, $Date: 2009-11-05 13:26:40 +0100 (Do, 05. Nov 2009) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Field Summary
static int ELEVATION_MODEL_GRID
          The elevationmodel uses a grid data serving datasource (e.g.
static int ELEVATION_MODEL_POINTS
          The elevationmodel uses a point data serving datasource (e.g WFS)
static int ELEVATION_MODEL_UNKNOWN
          No information about the elevationmodel is known (e.g. no elevationModel is set)
 
Constructor Summary
ResolutionStripe(Surface surface, double maximumResolution, double minimumResolution, double minimalHeight, double scale)
           
ResolutionStripe(Surface surface, double maximumResolution, double minimumResolution, double minimalHeight, String outputFormat, double scale)
           
 
Method Summary
 boolean addFeature(String key, DefaultSurface feature)
           
 void addFeatureCollectionDataSource(AbstractDataSource featureCollectionDataSource)
           
 boolean addTexture(String key, BufferedImage texture)
           
 void addTextureDataSource(AbstractDataSource textureDataSource)
           
 ResolutionStripe call()
          This call method is part of the Deegree Concurrent framework (Executor) .
 int compareTo(ResolutionStripe other)
           
 CoordinateSystem getCRSName()
           
 int getDGMType()
           
 TerrainModel getElevationModel()
           
 AbstractDataSource getElevationModelDataSource()
           
 ArrayList<AbstractDataSource> getFeatureCollectionDataSources()
           
 HashMap<String,DefaultSurface> getFeatures()
           
 javax.media.j3d.OrderedGroup getJava3DRepresentation()
          After a call to this class call method, it is possible to get a Java3D representation --in form of a BranchGroup-- of this resolutionStripe.
 double getMaxResolution()
           
 double getMaxResolutionAsScaleDenominator()
           
 List<javax.vecmath.Point3d> getMeassurepointsAsList()
           
 double getMinimalTerrainHeight()
           
 double getMinResolution()
           
 double getMinResolutionAsScaleDenominator()
           
 String getOutputFormat()
           
 int getRequestHeightForBBox()
           
 int getRequestWidthForBBox()
           
 BufferedImage getResultTexture()
           
 double getScale()
           
 Surface getSurface()
           
 HashMap<String,BufferedImage> getTextures()
           
 ArrayList<AbstractDataSource> getTexturesDataSources()
           
 void outputTextures()
          Outputs the textures to the tmp directory with following format: key_response:___res:_maxresolution__random_id.jpg this file will be deleted at jvm termination.
 void setElevationModel(TerrainModel elevationModel)
           
 void setElevationModelDataSource(AbstractDataSource elevationModelDataSource)
           
 void setElevationModelFromHeightMap(BufferedImage heightMap)
           
 void setElevationModelFromMeassurePoints(List<javax.vecmath.Point3d> pointList)
           
 void setOutputFormat(String outputFormat)
           
 void setTextureRetrievalException(String datasourceID, OGCWebServiceException exception)
           
 String toString()
           
 String toWKT()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEVATION_MODEL_UNKNOWN

public static final int ELEVATION_MODEL_UNKNOWN
No information about the elevationmodel is known (e.g. no elevationModel is set)

See Also:
Constant Field Values

ELEVATION_MODEL_GRID

public static final int ELEVATION_MODEL_GRID
The elevationmodel uses a grid data serving datasource (e.g. CSW)

See Also:
Constant Field Values

ELEVATION_MODEL_POINTS

public static final int ELEVATION_MODEL_POINTS
The elevationmodel uses a point data serving datasource (e.g WFS)

See Also:
Constant Field Values
Constructor Detail

ResolutionStripe

public ResolutionStripe(Surface surface,
                        double maximumResolution,
                        double minimumResolution,
                        double minimalHeight,
                        double scale)
Parameters:
surface - of this resolution stripe, after the stripeFactory it is a trapezium, after the quad-splitter an axis-alligned bbox, which will be a request.
maximumResolution - the largest resolution value, resulting in the smallest map Resolution, e.g. farthest away from the viewer.
minimumResolution - the smallest resolution value, resulting in the highest map Resolution, e.g. nearest to the viewer.
minimalHeight - the terrain height which will be taken if an error occurred while retrieving height data.
scale - of the heights ( 1.0 means no scaling )

ResolutionStripe

public ResolutionStripe(Surface surface,
                        double maximumResolution,
                        double minimumResolution,
                        double minimalHeight,
                        String outputFormat,
                        double scale)
Parameters:
surface - of this resolution stripe, after the stripeFactory it is a trapezium, after the quad-splitter an axis-alligned bbox, which will be a request.
maximumResolution - the largest resolution value, resulting in the smallest map Resolution, e.g. farthest away from the viewer.
minimumResolution - the smallest resolution value, resulting in the highest map Resolution, e.g. nearest to the viewer.
minimalHeight - the terrain height which will be taken if an error occurred while retrieving height data.
outputFormat - of the requests.
scale - of the heights ( 1.0 means no scaling )
Method Detail

getCRSName

public CoordinateSystem getCRSName()
Returns:
the CRS of this ResolutionStripe

getMaxResolution

public double getMaxResolution()
Returns:
the largest resolution value, resulting in the smallest map Resolution, e.g. farthest away from the viewer.

getMaxResolutionAsScaleDenominator

public double getMaxResolutionAsScaleDenominator()
Returns:
the (always possitive) resolution of the largest (away from the viewer) side of the surface as scale denominator, which means divide by MapUtils.DEFAULT_PIXEL_SIZE.

getMinResolutionAsScaleDenominator

public double getMinResolutionAsScaleDenominator()
Returns:
the (always possitive) resolution of the smallest (towards the viewer) side of the surface as scale denominator, which means divide by MapUtils.DEFAULT_PIXEL_SIZE.

getMinResolution

public double getMinResolution()
Returns:
the smallest resolution value, resulting in the highest map Resolution, e.g. nearest to the viewer.

getSurface

public Surface getSurface()
Returns:
the geometric surface which is defines this resolutionStripe.

getMinimalTerrainHeight

public double getMinimalTerrainHeight()
Returns:
the minimalTerrainHeight.

getRequestWidthForBBox

public int getRequestWidthForBBox()
Returns:
the requestwidth (in pixels) for the bbox containing this resolutionsstripe or -1 if the resolution is to high (e.g. int overload)

getRequestHeightForBBox

public int getRequestHeightForBBox()
Returns:
the height (in pixels) of the request envelope or -1 if the resolution is to high

getElevationModel

public TerrainModel getElevationModel()
Returns:
the elevationModel if no elevationModel is created jet, an TriangleTerrain elevation model of the bbox of this stripe (with heightvalues set to minimalheigt) is returned.

setElevationModel

public void setElevationModel(TerrainModel elevationModel)
Parameters:
elevationModel - An other elevationModel.

setElevationModelFromMeassurePoints

public void setElevationModelFromMeassurePoints(List<javax.vecmath.Point3d> pointList)
Parameters:
pointList - containing Points which represents the heights of measures points (normally aquired from a wfs).

setElevationModelFromHeightMap

public void setElevationModelFromHeightMap(BufferedImage heightMap)
Parameters:
heightMap - a BufferedImage which contains height values, normally aquired from a wcs.

getFeatures

public HashMap<String,DefaultSurface> getFeatures()
Returns:
the features of this resolutionstripe

addFeature

public boolean addFeature(String key,
                          DefaultSurface feature)
Parameters:
key - the name of the feature to be added.
feature - (e.g a building, tree etc.) as a DefaultSurface (derived frome Shape3D) to be added to the hashmap.
Returns:
true if the feature wasn't allready defined in the hashmap and could therefore be inserted, or if the key or feature are null.

getTextures

public HashMap<String,BufferedImage> getTextures()
Returns:
the textures value.

addTexture

public boolean addTexture(String key,
                          BufferedImage texture)
Parameters:
key - the name of the texture to be added.
texture - to be added to the hashmap.
Returns:
true if the texture wasn't allready defined in the hashmap and could therefore be inserted, or if the key or texture are null.

getElevationModelDataSource

public AbstractDataSource getElevationModelDataSource()
Returns:
the elevationModelDataSource value.

setElevationModelDataSource

public void setElevationModelDataSource(AbstractDataSource elevationModelDataSource)
Parameters:
elevationModelDataSource - An other elevationModelDataSource value.

getFeatureCollectionDataSources

public ArrayList<AbstractDataSource> getFeatureCollectionDataSources()
Returns:
the featureCollectionDataSources value.

addFeatureCollectionDataSource

public void addFeatureCollectionDataSource(AbstractDataSource featureCollectionDataSource)
Parameters:
featureCollectionDataSource - a DataSources for a specific featureCollection.

getTexturesDataSources

public ArrayList<AbstractDataSource> getTexturesDataSources()
Returns:
the texturesDataSources value.

addTextureDataSource

public void addTextureDataSource(AbstractDataSource textureDataSource)
Parameters:
textureDataSource - An other texturesDataSources value.

getOutputFormat

public String getOutputFormat()
Returns:
the OutputFormat of the resultImage

setOutputFormat

public void setOutputFormat(String outputFormat)
Parameters:
outputFormat - the mime type of the resultimage

getJava3DRepresentation

public javax.media.j3d.OrderedGroup getJava3DRepresentation()
After a call to this class call method, it is possible to get a Java3D representation --in form of a BranchGroup-- of this resolutionStripe. In this BranchGroup all the textures and requested features are added to the ElevationModel.

Returns:
a Java3D representation of this ResolutionStripe.

toString

public String toString()
Overrides:
toString in class Object

toWKT

public String toWKT()
Returns:
a well known representation of the geometry of this Resolutionstripe

outputTextures

public void outputTextures()
Outputs the textures to the tmp directory with following format: key_response:___res:_maxresolution__random_id.jpg this file will be deleted at jvm termination.


getScale

public double getScale()
Returns:
the scale of the heights (1.0 means no scaling)

getDGMType

public int getDGMType()
Returns:
one of the possible values ELEVATION_MODEL_UNKNOWN ELEVATION_MODEL_GRID ELEVATION_MODEL_POINTS

getResultTexture

public BufferedImage getResultTexture()
Returns:
the resultTexture, which is build from all requested (wms/wcs) textures.

call

public ResolutionStripe call()
                      throws OGCWebServiceException
This call method is part of the Deegree Concurrent framework (Executor) . In this case it requests all the Data for a ResolutionStripe by invoking the necessary webservices.

Specified by:
call in interface Callable<ResolutionStripe>
Throws:
OGCWebServiceException
See Also:
Callable.call()

setTextureRetrievalException

public void setTextureRetrievalException(String datasourceID,
                                         OGCWebServiceException exception)
Parameters:
datasourceID - the id of the datasources which received an exception while retrieving a texture.
exception - the exception that occured while invoking the datasource.

getMeassurepointsAsList

public final List<javax.vecmath.Point3d> getMeassurepointsAsList()
Returns:
the pointList

compareTo

public int compareTo(ResolutionStripe other)
Specified by:
compareTo in interface Comparable<ResolutionStripe>

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org