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(float n,
float w,
float s,
float e)
|
Method Summary |
double |
borderDistance(float lat,
float 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(float lat,
float lon)
|
boolean |
within(float n,
float w,
float s,
float 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 float north
south
public float south
west
public float west
east
public float east
QuadTreeRect
public QuadTreeRect(float n,
float w,
float s,
float e)
within
public boolean within(QuadTreeRect rect)
within
public boolean within(float n,
float w,
float s,
float e)
pointWithinBounds
public boolean pointWithinBounds(float lat,
float lon)
borderDistance
public double borderDistance(float lat,
float 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