gps_history library
The GPS History library provides facilities to store and query GPS points. This can be used to for example build a location tracking app.
Classes
 EarthRadiusMeters
 Class that operates as just a container for different types of Earth radii, expressed in meters.

GpcCompact<
T extends GpsPoint>  Implements compact storage for GpsPoint elements.
 GpcCompactGpsMeasurement
 Implements efficient storage for GpsMeasurement elements.
 GpcCompactGpsPoint
 Implements efficient storage for GpsPoint elements.
 GpcCompactGpsStay
 Implements efficient storage for GpsStay elements.

GpcEfficient<
T extends GpsPoint>  A spaceefficient GpsPointsCollection implementation.

GpcListBased<
T extends GpsPoint>  A collection that internally stores the points in a basic list.
 GpsMeasurement
 GPS point with additional information related to the measurement.
 GpsPoint
 Represents the most basic GPS location.

GpsPointsCollection<
T extends GpsPoint>  Stores GPS points with read/write access.

GpsPointsView<
T extends GpsPoint>  Readonly view on the GPS points stored in a GpsPointsCollection.
 GpsStay
 GPS point representing a stay in that location for some amount of time.
 GpsTime
 Represents a time value for GpsPoint and children.

GpvQuerier<
T extends GpsPoint>  A view that internally only stores indices in a referenced collections, and queries the collection for the points when required.
Enums
 DistanceCalcMode
 SortingEnforcement
 Indicates how the sorting requirement for GpsPointsCollection should behave.
 TimeComparisonResult
 Used as result type for time comparison.
Constants
 earthFlattening → const double
 maxAngleForSuperFastDeg → const int
 Up to what angle (roughly) is the fast method regarded as reliable (see documentation of this module for the considerations).
 metersPerDegreeLatitude → const double
Functions

compareIntRepresentationTime(
int timeA, int timeB) → TimeComparisonResult  Compares two time values and returns the result.

comparePointTimes(
GpsPoint itemA, GpsPoint itemB) → TimeComparisonResult 
Compares the time values of
itemA
anditemB
and returns the result. 
compareTime(
GpsTime timeA, GpsTime timeB) → TimeComparisonResult  Compares two time values and returns the result.

compareTimeSpans(
{required int startA, required int endA, required int startB, required int endB}) → TimeComparisonResult  Compares time spans representing for example two GpsStay entities.

degToRad(
double deg) → double 
Converts a value
deg
specified in degrees to radians. 
deltaLatitudeAbs(
double latADeg, double latBDeg) → double 
Returns the shortest latitude angle distance (in degrees) between two
points A and B with latitudes given by
latADeg
respectivelylatBDeg
, both in degrees. 
deltaLongitudeAbs(
double longADeg, double longBDeg) → double 
Returns the shortest longitude angle distance (in degrees) between two
points A and B with longitudes given by
longADeg
respectivelylongBDeg
, both in degrees. 
diffIntTime(
{required int startTimeA, required int? endTimeA, required int timeB}) → int 
Calculates the difference between
timeB
and a time or time span defined by astartTimeA
and optionally, if it's a span rather than an instance, anendTimeA
. The result will be negative and equal toendTimeA
timeB
if A is before B, positive and equal tostartTimeA
timeB
is A is after B. 
diffTime(
{required GpsTime startTimeA, required GpsTime? endTimeA, required GpsTime timeB}) → int  Like diffIntTime, but with parameters provided in GpsTime rather than directly as integers.

distance(
GpsPoint pointA, GpsPoint pointB, [DistanceCalcMode mode = DistanceCalcMode.auto]) → double 
Calculates the distance between
pointA
andpointB
, optionally using a specific calculationmode
to balance speed and accuracy. 
distanceCoords(
double latADeg, double longADeg, double latBDeg, double longBDeg, DistanceCalcMode mode) → double 
distanceCoordsEquirectangular(
double latADeg, double longADeg, double latBDeg, double longBDeg) → double 
Calculates an approximation of the distance in meters between point A
at spherical (latitude, longitude) coordinates (
latADeg
,longADeg
) and B at (latBDeg
,longBDeg
)  all in degrees, using the equirectangular approximation. 
distanceCoordsHaversine(
double latADeg, double longADeg, double latBDeg, double longBDeg, {dynamic earthRadiusMeters = EarthRadiusMeters.mean}) → double 
Calculates the distance in meters between point A at spherical
(latitude, longitude) coordinates (
latADeg
,longADeg
) and B at (latBDeg
,longBDeg
)  all in degrees, using the haversine formula. 
distanceCoordsLambert(
double latADeg, double longADeg, double latBDeg, double longBDeg) → double 
Calculates the distance in meters between point A at spherical
(latitude, longitude) coordinates (
latADeg
,longADeg
) and B at (latBDeg
,longBDeg
)  all in degrees, using Lambert's formula for maximum accuracy, taking into account the earth's ellipsoid shape. 
distanceCoordsSuperFast(
double latADeg, double longADeg, double latBDeg, double longBDeg) → double 
Calculates an approximation of the distance in meters between point A
at spherical (latitude, longitude) coordinates (
latADeg
,longADeg
) and B at (latBDeg
,longBDeg
)  all in degrees. 
getMetersPerLongitudeDegAtLatitudeDeg(
dynamic latitudeDeg) → double 
opposite(
TimeComparisonResult r) → TimeComparisonResult 
Returns the opposite of
r
. 
radToDeg(
double rad) → double 
Converts a value
rad
specified in radians to degrees.
Typedefs
Exceptions / Errors
 GpsHistoryException
 Exception class that can act as ancestor for exceptions raised by
 GpsInvalidValue
 Exception class for invalid values.
 GpsPointsViewSortingException
 Exception class for sorting issues in GpsPointsView (sub)classes.