turf_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.
<Unit, num>{Unit.acres : 0.000247105, Unit.centimeters : 10000, Unit.feet : 10.763910417, Unit.inches : 1550.003100006, Unit.kilometers : 0.000001, Unit.meters : 1, Unit.miles : 3.86e-7, Unit.mi…
- earthRadius → const double
-
Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.
6371008.8
-
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
<Unit, num>{Unit.centimeters : earthRadius * 100, Unit.degrees : earthRadius / 111325, Unit.feet : earthRadius * 3.28084, Unit.inches : earthRadius * 39.370, Unit.kilometers : earthRadius &#…
-
unitsFactors
→ const Map<
Unit, num> -
<Unit, num>{Unit.centimeters : 100, Unit.degrees : 1 / 111325, Unit.feet : 3.28084, Unit.inches : 39.370, Unit.kilometers : 1 / 1000, Unit.meters : 1, Unit.miles : 1 / 1609.344, Unit…
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