Class to hold a location value. More...
#include <TinyGPS++.h>
Public Member Functions | |
bool | isValid () const |
Returns true if the data is valid. More... | |
bool | isUpdated () const |
Returns true if the value has been updated since last read. More... | |
uint32_t | age () const |
Returns the age of the value in milliseconds. More... | |
const RawDegrees & | rawLat () |
Returns the raw latitude. More... | |
const RawDegrees & | rawLng () |
Returns the raw longitude. More... | |
double | lat () |
Returns the latitude in degrees as a signed double floating point value. More... | |
double | lng () |
Returns the longitude in degrees as a signed double floating point value. More... | |
void | invalidate () |
Sets the valid flag to false (marks data as invalid) More... | |
TinyGPSLocation () | |
Constructor. | |
Friends | |
class | TinyGPSPlus |
Class to hold a location value.
|
inline |
Returns the age of the value in milliseconds.
If the value is not valid, then ULONG_MAX is returned.
You might check to see if age is < 10000 to make sure the value has been retrieved in the last 10 seconds, for example.
|
inline |
Sets the valid flag to false (marks data as invalid)
This is used internally when we get a valid GPS sentence that does not have a fix. It can be checked by using the isValid() method.
|
inline |
Returns true if the value has been updated since last read.
The updated flag is set to false after reading data (lag, lng, rawLat, rawLng) and is set to true when a valid location is received from the GPS.
|
inline |
Returns true if the data is valid.
The valid flag will be false if the GPS loses its fix, but will not be invalidated if the GPS stops returning data. If that is a possibility, you should also check the age.
double TinyGPSLocation::lat | ( | ) |
Returns the latitude in degrees as a signed double floating point value.
Positive values are for north latitude. Negative values are for south latitude. Valid values are 0 <= lat() < 360.0
This method is not const because it clears the updated flag.
double TinyGPSLocation::lng | ( | ) |
Returns the longitude in degrees as a signed double floating point value.
Positive values are for west longitude. Negative values are for east longitude. Valid values are 0 <= lng() < 360.0
This method is not const because it clears the updated flag.
|
inline |
Returns the raw latitude.
The raw latitude separates out the whole part (in degrees), billionths of a degree, and sign, instead of using a double floating point number.
This method is not const because it clears the updated flag.
|
inline |
Returns the raw longitude.
The raw latitude separates out the whole part (in degrees), billionths of a degree, and sign, instead of using a double floating point number.
This method is not const because it clears the updated flag.