nsidc.spheres
Class LatLonBoundingBox

java.lang.Object
  extended bynsidc.spheres.LatLonBoundingBox

public class LatLonBoundingBox
extends java.lang.Object

LatLonBoundingBox class - provide services and information relating to a lat/lon bounding box.

A bounding box is a rectangle on a simple cylindrical projection. It is defined solely by lat/lon extremes and corner points are connected with rhumb lines. The top and bottom of a lat/lon bounding box go east/west, the sides go north/south.

This class assumes a flat, rectangular earth.


Field Summary
 double lat_max
          Maximum latitude of the bounding box.
 double lat_min
          Minimum latitude of the bounding box.
 double lon_max
          Maximum longitude of the bounding box.
 double lon_min
          Minimum longitude of the bounding box.
 LonRange lon_range
          Longitude range of the bounding box.
 double perimeter
          Perimeter (in degrees lat/lon) of the bounding box.
 
Constructor Summary
LatLonBoundingBox(double given_lat_min, double given_lat_max, double given_lon_min, double given_lon_max)
          Constructs a lat/lon bounding box.
LatLonBoundingBox(float given_lat_min, float given_lat_max, float given_lon_min, float given_lon_max)
          Constructs a lat/lon bounding box.
LatLonBoundingBox(java.lang.String given_lat_min, java.lang.String given_lat_max, java.lang.String given_lon_min, java.lang.String given_lon_max)
          Constructs a lat/lon bounding box.
 
Method Summary
 boolean contains(Point given_point)
          Determine if this box contains a given point.
 boolean overlaps(LatLonBoundingBox other)
          Determine if this bounding box overlaps another.
 boolean overlaps(Scene scene)
          Determine if this bounding box overlaps a scene.
 boolean overlaps(SphericalPolygon spolygon)
          Determine if this bounding box overlaps a sperical polygon.
protected  void systemLog(java.lang.String msg, int level)
          Log diagnostic messages
 SphericalPolygon toSphericalPolygon(int num_points)
          Convert the bounding box to a spherical polygon.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lat_min

public double lat_min
Minimum latitude of the bounding box.


lat_max

public double lat_max
Maximum latitude of the bounding box.


lon_min

public double lon_min
Minimum longitude of the bounding box.


lon_max

public double lon_max
Maximum longitude of the bounding box.


perimeter

public double perimeter
Perimeter (in degrees lat/lon) of the bounding box.


lon_range

public LonRange lon_range
Longitude range of the bounding box.

Constructor Detail

LatLonBoundingBox

public LatLonBoundingBox(double given_lat_min,
                         double given_lat_max,
                         double given_lon_min,
                         double given_lon_max)
Constructs a lat/lon bounding box.


LatLonBoundingBox

public LatLonBoundingBox(float given_lat_min,
                         float given_lat_max,
                         float given_lon_min,
                         float given_lon_max)
Constructs a lat/lon bounding box.


LatLonBoundingBox

public LatLonBoundingBox(java.lang.String given_lat_min,
                         java.lang.String given_lat_max,
                         java.lang.String given_lon_min,
                         java.lang.String given_lon_max)
Constructs a lat/lon bounding box.

Method Detail

contains

public boolean contains(Point given_point)
Determine if this box contains a given point.

It's just a lat/lon bounding box so we only have to check the ranges.

Parameters:
given_point - Point of interest.


overlaps

public boolean overlaps(LatLonBoundingBox other)
Determine if this bounding box overlaps another.

Returns:
true if the areas overlap.
false if the areas do not overlap.

overlaps

public boolean overlaps(Scene scene)
Determine if this bounding box overlaps a scene.

After determining if it's even possible, and we don't have the trivial case where one area is entirely inside the other, this method checks for arc instersections between the sides of the two areas. If any arcs intersect the areas overlap.

Returns:
true if the areas overlap.
false if the areas do not overlap.

See Also:
Scene, GreatCircleArc

overlaps

public boolean overlaps(SphericalPolygon spolygon)
Determine if this bounding box overlaps a sperical polygon.

After determining if it's even possible, and we don't have the trivial case where one area is entirely inside the other, this method checks for arc intersections between the sides of the two areas. If any arcs intersect the areas overlap.

Returns:
true if the areas overlap.
false if the areas do not overlap.

See Also:
SphericalPolygon, GreatCircleArc

toSphericalPolygon

public SphericalPolygon toSphericalPolygon(int num_points)
Convert the bounding box to a spherical polygon.

See Also:
SphericalPolygon

toString

public java.lang.String toString()

systemLog

protected void systemLog(java.lang.String msg,
                         int level)
Log diagnostic messages

Parameters:
msg - Message to log.
level - Debug sensitivity.