latlong library
Helps with latitude / longitude calculations.
For distance calculations the default algorithm Vincenty is used. Vincenty is a bit slower than Haversine but fare more accurate!
final Distance distance = new Distance();
// km = 423
final int km = distance.as(LengthUnit.Kilometer,
new LatLng(52.518611,13.408056),new LatLng(51.519475,7.46694444));
// meter = 422592
final int meter = distance(new LatLng(52.518611,13.408056),new LatLng(51.519475,7.46694444));
Find more infos on Movable Type Scripts and Movable Type Scripts - Vincenty
Classes
- Circle
- Circle-base GEO algorithms.
- Distance
- Calculates the distance between points.
- DistanceCalculator
- DistanceHaversine
- Shortcut for final Distance distance = const Distance(calculator: const Haversine());
- DistanceVincenty
- Shortcut for final Distance distance = const Distance(calculator: const Vincenty());
- Haversine
- LatLng
- Coordinates in Degrees
- LengthUnit
-
Path<
T extends LatLng> - Path of LatLng values
- Vincenty
Constants
- earthRadius → const double
- Earth radius in meter
- equatorRadius → const double
- Equator radius in meter (WGS84 ellipsoid)
- flattening → const double
- WGS84
- pi → const double
- The PI constant.
- polarRadius → const double
- Polar radius in meter (WGS84 ellipsoid)
Functions
-
decimal2sexagesimal(
double dec) → String - Converts a decimal coordinate value to sexagesimal format
-
degToRadian(
double deg) → double - Converts degree to radian
-
normalizeBearing(
double bearing) → double - Convert a bearing to be within the 0 to +360 degrees range. Compass bearing is in the rangen 0° ... 360°
-
radianToDeg(
double rad) → double - Radian to degree
-
round(
double value, {int decimals = 6}) → double -
Rounds
value
to given number ofdecimals
-
sexagesimal2decimal(
String str) → double - Converts a string coordinate value in sexagesimal format to decimal
-
zeroPad(
num number) → String - Pads a number with a single zero, if it is less than 10
Typedefs
- LatLngFactory = LatLng Function(double latitude, double longitude)
- Necessary for creating new instances T extends LatLng (Path