LatLonPoint Class Reference

Stores a latitude/longitude coordinate pair. More...

#include <GeoPoint.h>

List of all members.

Public Member Functions

 LatLonPoint ()
 LatLonPoint (LocationType latLon)
 LatLonPoint (const std::string &latitudeText, const std::string &longitudeText)
 LatLonPoint (const std::string &latLonText)
 ~LatLonPoint ()
LocationType getCoordinates () const
const DmsPointgetLatitude () const
const DmsPointgetLongitude () const
std::string getText (DmsFormatType format=DMS_FULL, int precision=-1) const
std::string getLatitudeText (DmsFormatType format=DMS_FULL, int precision=-1) const
std::string getLongitudeText (DmsFormatType format=DMS_FULL, int precision=-1) const
LatLonPointoperator= (const LatLonPoint &original)
bool operator== (const LatLonPoint &rhs) const


Detailed Description

Stores a latitude/longitude coordinate pair.

This class stores a latitude/longitude pair as DmsPoint objects to provide common text formatting when retrieving the value. In addition to the text formatting, the raw value can also be retrieved.

See also:
DmsPoint

Definition at line 165 of file GeoPoint.h.


Constructor & Destructor Documentation

LatLonPoint::LatLonPoint (  ) 

Creates a latitude/longitude point with an initial value of 0° N and 0° E.

LatLonPoint::LatLonPoint ( LocationType  latLon  ) 

Creates a latitude/longitude point with initial raw values.

Parameters:
latLon The initial latitude and longitude coordinate. The latitude value must correspond to the x-coordinate of the LocationType, and the longitude value must correspond to the y-coordinate.

LatLonPoint::LatLonPoint ( const std::string &  latitudeText,
const std::string &  longitudeText 
)

Creates a latitude/longitude point with a initial string values for both latitude and longitude.

Parameters:
latitudeText A string representing the initial latitude value that can be converted to a numeric raw value.
longitudeText A string representing the initial longitude value that can be converted to a numeric raw value.

LatLonPoint::LatLonPoint ( const std::string &  latLonText  ) 

Creates a latitude/longitude point with an initial string value.

Parameters:
latLonText A string representing the initial latitude and longitude value that can be converted to numeric raw values.

LatLonPoint::~LatLonPoint (  ) 

Destroys the latitude/longitude point.


Member Function Documentation

LocationType LatLonPoint::getCoordinates (  )  const

Returns the raw value of the latitude/longitude point.

Returns:
The latitude/longitude coordinate. The latitude value is stored in the LocationType x-coordinate, and the longitude value is stored in the y-coordinate.
See also:
getLatitude(), getLongitude(), getText()

const DmsPoint& LatLonPoint::getLatitude (  )  const

Retrieves the latitude value.

Returns:
A reference to the DMS point containing the latitude value.
See also:
DmsPoint

const DmsPoint& LatLonPoint::getLongitude (  )  const

Retrieves the longitude value.

Returns:
A reference to the DMS point containing the longitude value.
See also:
DmsPoint

std::string LatLonPoint::getText ( DmsFormatType  format = DMS_FULL,
int  precision = -1 
) const

Returns the latitude/longitude coordinate in a given text format.

Parameters:
format The text format for the string.
precision The number of digits after decimal point. Defaults to three for decimal degrees and seconds and two for decimal minutes.
Returns:
The value of the latitude/longitude coordinate as a formatted string.
See also:
DmsFormatType, getCoordinates(), getLatitudeText(), getLongitudeText()

std::string LatLonPoint::getLatitudeText ( DmsFormatType  format = DMS_FULL,
int  precision = -1 
) const

Returns the latitude value in a given text format.

Parameters:
format The text format for the string.
precision The number of digits after decimal point. Defaults to three for decimal degrees and seconds and two for decimal minutes.
Returns:
The latitude value as a formatted string.
See also:
DmsFormatType, getText(), getLongitudeText()

std::string LatLonPoint::getLongitudeText ( DmsFormatType  format = DMS_FULL,
int  precision = -1 
) const

Returns the longitude value in a given text format.

Parameters:
format The text format for the string.
precision The number of digits after decimal point. Defaults to three for decimal degrees and seconds and two for decimal minutes.
Returns:
The longitude value as a formatted string.
See also:
DmsFormatType, getText(), getLatitudeText()

LatLonPoint& LatLonPoint::operator= ( const LatLonPoint original  ) 

Sets the latitude and longitude values to that of another latitude/longitude point.

Parameters:
original The point from which to set this point's values.
Returns:
A reference to this latitude/longitude point, whose values have changed.

bool LatLonPoint::operator== ( const LatLonPoint rhs  )  const

Compares two latitude/longitude points.

Parameters:
rhs The latitude/longitude point to compare the values against this point.
Returns:
Returns true if the values of the given point are identical to the values of this point; otherwise returns false.


Software Development Kit - Opticks 4.9.0 Build 16218