net.agmodel.physical
Class GeographicalPolygon

java.lang.Object
  extended bynet.agmodel.physical.GeographicalPolygon
All Implemented Interfaces:
GeographicalArea, Serializable

public class GeographicalPolygon
extends Object
implements Serializable, GeographicalArea

See Also:
Serialized Form

Field Summary
static GeographicalPolygon UNKNOWN
           
 
Fields inherited from interface net.agmodel.physical.GeographicalArea
EVEREST, METRESPERDEGREEOFLATITUDE, METRESPERDEGREEOFLONGATEQUATOR, METRESPERPIXEL
 
Constructor Summary
GeographicalPolygon(Location2D[] boundary)
           
 
Method Summary
 boolean contains(GeographicalArea anotherArea)
          Indicate whether the area passed falls entirely within this area
 boolean contains(Location2D point)
          Indicate whether a point is within the area
 GeographicalBox getBoundingBox()
          Return a box which bounds the area.
 Location2D getPoint(int i)
           
 int getPointCount()
           
 boolean isUnknown()
          Indicates whether the bounds of this area are unknown.
 boolean overlapsWith(GeographicalArea area)
          Indicate whether the supplied area overlaps with this area.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final GeographicalPolygon UNKNOWN
Constructor Detail

GeographicalPolygon

public GeographicalPolygon(Location2D[] boundary)
Method Detail

getPointCount

public int getPointCount()

getPoint

public Location2D getPoint(int i)

contains

public boolean contains(Location2D point)
Description copied from interface: GeographicalArea
Indicate whether a point is within the area

Specified by:
contains in interface GeographicalArea
Parameters:
point - the point of interest
Returns:
true if it is, and false if it isn't

contains

public boolean contains(GeographicalArea anotherArea)
Description copied from interface: GeographicalArea
Indicate whether the area passed falls entirely within this area

Specified by:
contains in interface GeographicalArea
Parameters:
anotherArea - the area of interest
Returns:
true if both areas are known, and the other area is entirely within the bounds of this area, false otherwise

getBoundingBox

public GeographicalBox getBoundingBox()
Description copied from interface: GeographicalArea
Return a box which bounds the area. This can be used as the basis of approximate implementations of overlapsWith for arbitrary shapes. If isUnknown() returns true for the area, then returns GeographicalBox.UNKNOWN

Specified by:
getBoundingBox in interface GeographicalArea
Returns:
a 3 dimensional bounding box

overlapsWith

public boolean overlapsWith(GeographicalArea area)
Description copied from interface: GeographicalArea
Indicate whether the supplied area overlaps with this area. See getBoundingBox for a way of approximately implementing this for arbitrary shapes. Suggestions for improvement welcome. If isUnknown() returns true for either or both areas, the result is false;

Specified by:
overlapsWith in interface GeographicalArea
Parameters:
area - the area of interest

isUnknown

public boolean isUnknown()
Description copied from interface: GeographicalArea
Indicates whether the bounds of this area are unknown.

Specified by:
isUnknown in interface GeographicalArea
Returns:
true if the bounds are unknown.


Copyright (C) NARC 2001 All Rights Reserved.