com.bbn.openmap.geo
Interface GeoArray

All Known Subinterfaces:
GeoArray.Mutable
All Known Implementing Classes:
GeoArray.Adapter, GeoArray.Double, GeoArray.Float

public interface GeoArray

A GeoArray is a interface that represents a set of Geo information. Rather than keeping a set of Geo[] around and managing the memory for all of those objects, the GeoArray provides an object that just holds onto the coordinates of those points.

Author:
dietrick

Nested Class Summary
static class GeoArray.Adapter
          An abstract parent implementation class of GeoArray that handles common methods.
static class GeoArray.Double
          An implementation of GeoArray and GeoArray.Mutable that contains double-precision values.
static class GeoArray.Float
          An implementation of GeoArray and GeoArray.Mutable that contains float-precision values.
static interface GeoArray.Mutable
          A Mutable GeoArray is one where the points can be modified.
 
Method Summary
 double area()
          Compute the area of the GeoArray polygon on the surface of a unit sphere given an enumeration of its point.
 void closeArray()
          Ensure that the Geo array starts and ends with the same values.
 boolean equals(int index, Geo comp)
           
 Geo get(int i)
          Get a Geo represented by the index i.
 Geo get(int i, Geo ret)
          Load the values for Geo at index i into ret.
 int getSize()
          Get the number of Geo points represented by this array.
 void removeDups()
          Modify, if needed, the Geo array with the duplicates removed.
 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.
 

Method Detail

get

public Geo get(int i)
Get a Geo represented by the index i.

Parameters:
i -
Returns:

get

public Geo get(int i,
               Geo ret)
Load the values for Geo at index i into ret.

Parameters:
i -
ret -
Returns:

getSize

public int getSize()
Get the number of Geo points represented by this array.

Returns:

toPointArray

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

Returns:

toLLDegrees

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

Returns:

toLLRadians

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

Returns:

equals

public boolean equals(int index,
                      Geo comp)
Parameters:
index - the index of the Geo in the GeoArray to compare.
comp - the Geo to compare to the indexed value.
Returns:
true of x, y, and z of the Geos match.

area

public double area()
Compute the area of the GeoArray polygon on the surface of a unit sphere given an enumeration of its point. For a non unit sphere, multiply this by the radius of sphere squared.

Returns:
area value.

closeArray

public void closeArray()
Ensure that the Geo array starts and ends with the same values. Will replace the current coord array with one three floats longer if needed.


removeDups

public void removeDups()
Modify, if needed, the Geo array with the duplicates removed.



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