com.bbn.openmap.util.quadtree
Class QuadTreeRect
java.lang.Object
com.bbn.openmap.util.quadtree.QuadTreeRect
- All Implemented Interfaces:
- java.io.Serializable
public class QuadTreeRect
- extends java.lang.Object
- implements java.io.Serializable
- See Also:
- Serialized Form
Constructor Summary |
QuadTreeRect(double n,
double w,
double s,
double e)
|
Method Summary |
double |
borderDistance(double lat,
double lon)
A utility method to figure out the closest distance of a border to a
point. |
double |
borderDistanceSqr(double lat,
double lon)
Notice the change from borderDistance() to borderDistanceSqr() since
distance squared must be used throughout, which is now given by: |
boolean |
pointWithinBounds(double lat,
double lon)
|
boolean |
within(double n,
double w,
double s,
double e)
|
boolean |
within(QuadTreeRect rect)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
north
public double north
south
public double south
west
public double west
east
public double east
QuadTreeRect
public QuadTreeRect(double n,
double w,
double s,
double e)
within
public boolean within(QuadTreeRect rect)
within
public boolean within(double n,
double w,
double s,
double e)
pointWithinBounds
public boolean pointWithinBounds(double lat,
double lon)
borderDistance
public double borderDistance(double lat,
double lon)
- A utility method to figure out the closest distance of a border to a
point. If the point is inside the rectangle, return 0.
- Parameters:
lat
- up-down location in QuadTree Grid (latitude, y)lon
- left-right location in QuadTree Grid (longitude, x)
- Returns:
- closest distance to the point.
borderDistanceSqr
public double borderDistanceSqr(double lat,
double lon)
- Notice the change from borderDistance() to borderDistanceSqr() since
distance squared must be used throughout, which is now given by:
- Parameters:
lat
- lon
-
- Returns:
- border distance squared
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details