org.placelab.core
Interface Coordinate

All Known Implementing Classes:
FixedTwoDCoordinate, TwoDCoordinate

public interface Coordinate

A Coordinate represents a point on EarthModel. It does not expose any methods with doubles, because not all Placelab platforms support floating point math.


Method Summary
 void constructFromMap(java.util.Hashtable map)
          Constructs from a Hashtable.
 void constructFromNMEA(java.lang.String latNMEA, java.lang.String latHem, java.lang.String lonNMEA, java.lang.String lonHem)
          Constructs a Coordinate from the NMEA specification for Coordinates which is a hemisphere and a lat and lon in hhmm.sssss format.
 void constructFromStrings(java.lang.String lat, java.lang.String lon)
          Constructs a Coordinate from String representations of lat and lon as doubles in hh.ddddd format
 Coordinate createClone()
           
 java.lang.String distanceFromAsString(Coordinate other)
           
 int distanceFromInMeters(Coordinate other)
           
 java.lang.String getLatitudeAsString()
           
 java.lang.String getLatitudeHemisphereNMEA()
           
 java.lang.String getLatitudeNMEA()
           
 java.lang.String getLongitudeAsString()
           
 java.lang.String getLongitudeHemisphereNMEA()
           
 java.lang.String getLongitudeNMEA()
           
 boolean isNull()
          The Null coordinate is a Coordinate which does not map to anywhere at all.
 java.lang.String toString()
           
 Coordinate translate(int north, int east)
          Provides a new Coordinate at a position translated from an existing one
 boolean within(Coordinate c1, Coordinate c2)
          c1 and c2 define opposing corners of a rectangular region.
 

Method Detail

constructFromStrings

public void constructFromStrings(java.lang.String lat,
                                 java.lang.String lon)
Constructs a Coordinate from String representations of lat and lon as doubles in hh.ddddd format


constructFromNMEA

public void constructFromNMEA(java.lang.String latNMEA,
                              java.lang.String latHem,
                              java.lang.String lonNMEA,
                              java.lang.String lonHem)
Constructs a Coordinate from the NMEA specification for Coordinates which is a hemisphere and a lat and lon in hhmm.sssss format.


constructFromMap

public void constructFromMap(java.util.Hashtable map)
Constructs from a Hashtable. The Hashtable should have the following structure:
 Types.LATITUDE=latitude as a String in hh.dddddd format
 Types.LONGITUDE=longitude as a String in hh.ddddd format
 

See Also:
Types#newCoordinate(HashMap)

createClone

public Coordinate createClone()

isNull

public boolean isNull()
The Null coordinate is a Coordinate which does not map to anywhere at all. Returns true if this coordinate is the Null coordinate.


within

public boolean within(Coordinate c1,
                      Coordinate c2)
c1 and c2 define opposing corners of a rectangular region. This method returns true if this Coordinate falls in that region.


translate

public Coordinate translate(int north,
                            int east)
Provides a new Coordinate at a position translated from an existing one

Parameters:
north - the number of meters to translate north
east - the number of meters to translate east
Returns:
a new Coordinate which is translated from the existing one according to the parameters

toString

public java.lang.String toString()

getLatitudeAsString

public java.lang.String getLatitudeAsString()

getLongitudeAsString

public java.lang.String getLongitudeAsString()

distanceFromAsString

public java.lang.String distanceFromAsString(Coordinate other)

distanceFromInMeters

public int distanceFromInMeters(Coordinate other)

getLatitudeNMEA

public java.lang.String getLatitudeNMEA()

getLongitudeNMEA

public java.lang.String getLongitudeNMEA()

getLatitudeHemisphereNMEA

public java.lang.String getLatitudeHemisphereNMEA()

getLongitudeHemisphereNMEA

public java.lang.String getLongitudeHemisphereNMEA()