com.bbn.openmap.geo
Class GeoArray.Adapter

java.lang.Object
  extended by com.bbn.openmap.geo.GeoArray.Adapter
All Implemented Interfaces:
GeoArray
Direct Known Subclasses:
GeoArray.Double, GeoArray.Float
Enclosing interface:
GeoArray

public abstract static class GeoArray.Adapter
extends java.lang.Object
implements GeoArray

An abstract parent implementation class of GeoArray that handles common methods.

Author:
dietrick

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bbn.openmap.geo.GeoArray
GeoArray.Adapter, GeoArray.Double, GeoArray.Float, GeoArray.Mutable
 
Constructor Summary
GeoArray.Adapter()
           
 
Method Summary
 double area()
          Computes the area of a polygon on the surface of a unit sphere.
 double[] toLLDegrees()
          Convert the GeoArray to an array of decimal degree values, alternating lat, lon, lat, lon.
 double[] toLLRadians()
          Convert the GeoArray to an array of radian values, alternating lat, lon, lat, lon.
 Geo[] toPointArray()
          Convert the GeoArray to an array of Geos.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.geo.GeoArray
closeArray, equals, get, get, getSize, removeDups
 

Constructor Detail

GeoArray.Adapter

public GeoArray.Adapter()
Method Detail

toPointArray

public Geo[] toPointArray()
Convert the GeoArray to an array of Geos.

Specified by:
toPointArray in interface GeoArray
Returns:
Geo[]

toLLDegrees

public double[] toLLDegrees()
Convert the GeoArray to an array of decimal degree values, alternating lat, lon, lat, lon.

Specified by:
toLLDegrees in interface GeoArray
Returns:
lat/lon double[] of decimal degrees

toLLRadians

public double[] toLLRadians()
Convert the GeoArray to an array of radian values, alternating lat, lon, lat, lon.

Specified by:
toLLRadians in interface GeoArray
Returns:
lat/lon double[] of radians

area

public double area()
Computes the area of a polygon on the surface of a unit sphere. For a non unit sphere, multiply this by the radius of sphere squared. The value might be negative based on the counter-clockwise order of the coordinates, but the absolute value is valid. This method will test for closed polygon coordinates and handle that situation.

Specified by:
area in interface GeoArray
Returns:
area value.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details