deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.ogcwebservices.wpvs.utils
Class QuadTreeSplitter

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

public class QuadTreeSplitter
extends java.lang.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: 23585 $, $Date: 2010-04-13 14:07:18 +0200 (Di, 13 Apr 2010) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Constructor Summary
QuadTreeSplitter(java.util.ArrayList<ResolutionStripe> resolutionStripes, double imageWidth, boolean highQuality)
          Creates a new Quadtree, from the given resolutionstripes.
 
Method Summary
 java.util.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(java.awt.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(java.util.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 java.util.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(java.awt.Graphics2D g2d)
Outputs the tree

Parameters:
g2d - if the quadtree should be drawn.

deegree 2.5 (2011/06/29 09:44 build-8-official)

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