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

org.deegree.ogcwebservices.wpvs.utils
Class QuadTreeSplitter

java.lang.Object
  extended by org.deegree.ogcwebservices.wpvs.utils.QuadTreeSplitter

public class QuadTreeSplitter
extends Object

The QuadTreeSplitter class can be used to create x-y axis alligned request quads from a qiven List of ResolutionStripe s. These Stripes depend on the ViewFrustrum and it's projection on the x-y plane (the so called footprint). To create an approximation of this footprint a Quadtree (a geometric spatial structure, which recursively divides a boundingbox into four containing boundingboxes) is built. The leafs of this tree are merged according to their resolution and size to create the requeststripes.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Constructor Summary
QuadTreeSplitter(ArrayList<ResolutionStripe> resolutionStripes, double imageWidth, boolean highQuality)
          Creates a new Quadtree, from the given resolutionstripes.
 
Method Summary
 ArrayList<ResolutionStripe> getRequestQuads(double extraRequestPercentage, int quadMergeCount)
          After instantiating a Quadtree, this method can be called to build the (x-y) axis-alligned request stripes.
 void outputTree(Graphics2D g2d)
          Outputs the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadTreeSplitter

public QuadTreeSplitter(ArrayList<ResolutionStripe> resolutionStripes,
                        double imageWidth,
                        boolean highQuality)
Creates a new Quadtree, from the given resolutionstripes. The resulting tree can be used to generate requeststripes which are (x-y) axis aligned.

The Quality argument is used for the recursive termination criteria, if it is set to true the requeststripes will accurately approximate the footprint (=projection of the viewfrustrum onto the ground) and the resolutions given in the resolutionstripes this results in a lot of requests which can slow down the wpvs. If set to false the footprint and the given resolutions will be approximated poorly but only a few requeststripes are created, resulting in a faster wpvs.

Parameters:
resolutionStripes - the different resolutionstripes.
imageWidth - the width of the target image, necessary for calculating the width resolution of the requeststripe.
highQuality - true if accurate (but many) requeststripes should be generated, false if none accurate (but only a few) requests should be generated.
Method Detail

getRequestQuads

public ArrayList<ResolutionStripe> getRequestQuads(double extraRequestPercentage,
                                                   int quadMergeCount)
After instantiating a Quadtree, this method can be called to build the (x-y) axis-alligned request stripes.

Parameters:
extraRequestPercentage - a percentage to be added to the resulting stripes ( a value between [0,1] ), which might correct gapes between stripes.WPVSDeegreeParams.getExtendRequestPercentage()
quadMergeCount - the number of leaves this splitter can have, before it starts merging leaves together WPVSDeegreeParams.getQuadMergeCount()
Returns:
the (x-y) axis-alligned request squares best fitted the given resolutionstripes.

outputTree

public void outputTree(Graphics2D g2d)
Outputs the tree

Parameters:
g2d - if the quadtree should be drawn.

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