org.kaboum.util
Class KaboumExtent

java.lang.Object
  extended by org.kaboum.util.KaboumExtent

public class KaboumExtent
extends java.lang.Object

This class define a spatial extent.

Author:
Jérôme Gasperi aka jrom

Field Summary
 double xMax
          Upper right X coordinate
 double xMin
          Lower left X coordinate
 double yMax
          Upper right Y coordinate
 double yMin
          Lower left Y coordinate
 boolean zoomOnShapes
          in case of item query map mode, tells if kaboum should zoom on the found features.
 
Constructor Summary
KaboumExtent()
          Default Constructor
KaboumExtent(double xMin, double yMin, double xMax, double yMax)
          Constructor
KaboumExtent(KaboumCoordinate coordLL, KaboumCoordinate coordUR)
          Constructor
 
Method Summary
 boolean contains(KaboumCoordinate c)
          Checks if extent contains Coordinate c
 boolean contains(KaboumExtent e)
          Checks if currentExtent contains another extent e
 double dx()
          Return the deltaX i.e.
 double dy()
          Return the deltaY i.e.
 void expandToInclude(KaboumCoordinate p)
          Enlarges the boundary of the Envelope so that it contains (x,y).
 void expandToInclude(KaboumExtent other)
          Enlarges the boundary of the Extent so that it contains other.
 int getSizeInPixels(double d, int width)
          Return the equivalent size in pixel of a distance in map unit within a given size
 void init()
          Initialize this extent
 boolean isNull()
          Returns true if this Envelope is a "null" extent.
 java.lang.String kaboumExternalString()
          Return a string version of this extent in a Kaboum output readable format
 java.lang.String msString()
          Return a string version of this extent in a mapserver cgi readable form
 boolean overlap(KaboumExtent e)
          Checks if extent e overlap currentExtent
 void set(KaboumExtent e)
          Set the extent e to the current Extent
static void setPM(KaboumPrecisionModel _pm)
          Set the precision model
 boolean trulyContains(KaboumCoordinate c)
          Checks if extent truly contains coordinate c.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xMin

public double xMin
Lower left X coordinate


yMin

public double yMin
Lower left Y coordinate


xMax

public double xMax
Upper right X coordinate


yMax

public double yMax
Upper right Y coordinate


zoomOnShapes

public boolean zoomOnShapes
in case of item query map mode, tells if kaboum should zoom on the found features. true to zoom on the found features, false to keep current extent.

Constructor Detail

KaboumExtent

public KaboumExtent()
Default Constructor


KaboumExtent

public KaboumExtent(double xMin,
                    double yMin,
                    double xMax,
                    double yMax)
Constructor

Parameters:
xMin - Lower left X coordinate
yMin - Lower left Y coordinate
xMax - Upper right X coordinate
yMax - Upper right Y coordinate

KaboumExtent

public KaboumExtent(KaboumCoordinate coordLL,
                    KaboumCoordinate coordUR)
Constructor

Parameters:
coordUL - Lower left coordinate
coordUR - Upper right coordinate
Method Detail

set

public void set(KaboumExtent e)
Set the extent e to the current Extent


overlap

public boolean overlap(KaboumExtent e)
Checks if extent e overlap currentExtent

Parameters:
e - Extent to check overlapping with the current one

contains

public boolean contains(KaboumExtent e)
Checks if currentExtent contains another extent e

Parameters:
e - Extent

contains

public boolean contains(KaboumCoordinate c)
Checks if extent contains Coordinate c

Parameters:
c - coordinate

trulyContains

public boolean trulyContains(KaboumCoordinate c)
Checks if extent truly contains coordinate c. Point that lie under the limit of the extent are not inside the extent.

Parameters:
c - coordinate

dx

public double dx()
Return the deltaX i.e. (xMax - xMin)


dy

public double dy()
Return the deltaY i.e. (yMax - yMin)


getSizeInPixels

public int getSizeInPixels(double d,
                           int width)
Return the equivalent size in pixel of a distance in map unit within a given size


expandToInclude

public void expandToInclude(KaboumCoordinate p)
Enlarges the boundary of the Envelope so that it contains (x,y). Does nothing if (x,y) is already on or within the boundaries.

Parameters:
p - input coordinate

expandToInclude

public void expandToInclude(KaboumExtent other)
Enlarges the boundary of the Extent so that it contains other. Does nothing if other is wholly on or within the boundaries.

Parameters:
other - the Extent to merge with

isNull

public boolean isNull()
Returns true if this Envelope is a "null" extent.

Returns:
true if this Extent is uninitialized

init

public void init()
Initialize this extent


kaboumExternalString

public java.lang.String kaboumExternalString()
Return a string version of this extent in a Kaboum output readable format


msString

public java.lang.String msString()
Return a string version of this extent in a mapserver cgi readable form

Parameters:
pm - Precision Model

setPM

public static void setPM(KaboumPrecisionModel _pm)
Set the precision model



Copyright © 2005 Kaboum team. All Rights Reserved.