helpers library

Classes

BBox
Please make sure, you arrange your parameters like this: Longitude 1, Latitude 1, Altitude 1 (optional), Longitude 2, Latitude 2, Altitude 2 (optional) You can either specify 4 or 6 parameters If you are using the default constructor with two dimensional positions (lng + lat only), please use the constructor like this: BBox(lng1, lat1, lng2, lat2);
CoordinateType
Coordinate types, following https://tools.ietf.org/html/rfc7946#section-4
Feature<T extends GeometryObject>
Feature, as specified here https://tools.ietf.org/html/rfc7946#section-3.2
FeatureCollection<T extends GeometryObject>
FeatureCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.3
GeoJSONObject
GeometryCollection
GeometryCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.8
GeometryObject
GeometryType<T>
LineString
LineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.4
MultiLineString
MultiLineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.5
MultiPoint
MultiPoint, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.3
MultiPolygon
MultiPolygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.7
Point
Point, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.2
Polygon
Polygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.6
Position
Please make sure, you arrange your parameters like this:

Constants

areaFactors → const Map<Unit, num>
Area of measurement factors based on 1 square meter.
earthRadius → const double
Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.
factors → const Map<Unit, num>
Unit of measurement factors using a spherical (non-ellipsoid) earth radius. Keys are the name of the unit, values are the number of that unit in a single radian
unitsFactors → const Map<Unit, num>

Functions

bearingToAzimuth(num bearing) num
Converts any bearing angle from the north line direction (positive clockwise) and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line
convertArea(num area, [dynamic originalUnit = Unit.meters, dynamic finalUnit = Unit.kilometers]) num
Converts a area to the requested unit. Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares
convertLength(num length, [Unit originalUnit = Unit.kilometers, Unit finalUnit = Unit.kilometers]) num
Converts a length to the requested unit. Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
degreesToRadians(num degrees) num
Converts an angle in degrees to radians
lengthToDegrees(num distance, [Unit unit = Unit.kilometers]) num
Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet
lengthToRadians(num distance, [Unit unit = Unit.kilometers]) num
Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
radiansToDegrees(num radians) num
Converts an angle in radians to degrees
radiansToLength(num radians, [Unit unit = Unit.kilometers]) num
Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit. Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
round(num value, [num precision = 0]) num
Round number to precision