Class TurfConstants

java.lang.Object
com.mapbox.turf.TurfConstants

public class TurfConstants extends Object
This class holds the Turf constants which are useful when specifying additional information such as units prior to executing the Turf function. For example, if I intend to get the distance between two GeoJson Points using TurfMeasurement.distance(Point, Point, String) the third optional parameter can define the output units.

Note that TurfConversion.convertLength(double, String, String) can be used to transform one unit to another, such as miles to feet.

Since:
1.2.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Retention policy for the various Turf units.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A centimeter (American spelling) is a unit of length in the metric system, equal to one hundredth of a meter.
    static final String
    A centimetre (international spelling) is a unit of length in the metric system, equal to one hundredth of a meter.
    static final String
    The default unit used in most Turf methods when no other unit is specified is kilometers.
    static final String
    A degree, is a measurement of a plane angle, defined so that a full rotation is 360 degrees.
    static final String
    The foot is a unit of length in the imperial and US customary systems of measurement.
    static final String
    The inch (abbreviation: in or ") is a unit of length in the (British) imperial and United States customary systems of measurement now formally equal to 1/36th yard but usually understood as 1/12th of a foot.
    static final String
    The kilometer (American spelling) is a unit of length in the metric system, equal to one thousand meters.
    static final String
    The kilometre (international spelling) is a unit of length in the metric system, equal to one thousand metres.
    static final String
    The metre (international spelling) or meter (American spelling) is the base unit of length in the International System of Units (SI).
    static final String
    The metre (international spelling) is the base unit of length in the International System of Units (SI).
    static final String
    The mile is an English unit of length of linear measure equal to 5,280 feet, or 1,760 yards, and standardised as exactly 1,609.344 meters by international agreement in 1959.
    static final String
    The nautical mile per hour is known as the knot.
    static final String
    The radian is the standard unit of angular measure, used in many areas of mathematics.
    static final String
    The yard (abbreviation: yd) is an English unit of length, in both the British imperial and US customary systems of measurement, that comprises 3 feet or 36 inches.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNIT_MILES

      public static final String UNIT_MILES
      The mile is an English unit of length of linear measure equal to 5,280 feet, or 1,760 yards, and standardised as exactly 1,609.344 meters by international agreement in 1959.
      Since:
      1.2.0
      See Also:
    • UNIT_NAUTICAL_MILES

      public static final String UNIT_NAUTICAL_MILES
      The nautical mile per hour is known as the knot. Nautical miles and knots are almost universally used for aeronautical and maritime navigation, because of their relationship with degrees and minutes of latitude and the convenience of using the latitude scale on a map for distance measuring.
      Since:
      1.2.0
      See Also:
    • UNIT_KILOMETERS

      public static final String UNIT_KILOMETERS
      The kilometer (American spelling) is a unit of length in the metric system, equal to one thousand meters. It is now the measurement unit used officially for expressing distances between geographical places on land in most of the world; notable exceptions are the United States and the road network of the United Kingdom where the statute mile is the official unit used.

      In many Turf calculations, if a unit is not provided, the output value will fallback onto using this unit. See UNIT_DEFAULT for more information.

      Since:
      1.2.0
      See Also:
    • UNIT_RADIANS

      public static final String UNIT_RADIANS
      The radian is the standard unit of angular measure, used in many areas of mathematics.
      Since:
      1.2.0
      See Also:
    • UNIT_DEGREES

      public static final String UNIT_DEGREES
      A degree, is a measurement of a plane angle, defined so that a full rotation is 360 degrees.
      Since:
      1.2.0
      See Also:
    • UNIT_INCHES

      public static final String UNIT_INCHES
      The inch (abbreviation: in or ") is a unit of length in the (British) imperial and United States customary systems of measurement now formally equal to 1/36th yard but usually understood as 1/12th of a foot.
      Since:
      1.2.0
      See Also:
    • UNIT_YARDS

      public static final String UNIT_YARDS
      The yard (abbreviation: yd) is an English unit of length, in both the British imperial and US customary systems of measurement, that comprises 3 feet or 36 inches.
      Since:
      1.2.0
      See Also:
    • UNIT_METERS

      public static final String UNIT_METERS
      The metre (international spelling) or meter (American spelling) is the base unit of length in the International System of Units (SI).
      Since:
      1.2.0
      See Also:
    • UNIT_CENTIMETERS

      public static final String UNIT_CENTIMETERS
      A centimeter (American spelling) is a unit of length in the metric system, equal to one hundredth of a meter.
      Since:
      1.2.0
      See Also:
    • UNIT_FEET

      public static final String UNIT_FEET
      The foot is a unit of length in the imperial and US customary systems of measurement.
      Since:
      1.2.0
      See Also:
    • UNIT_CENTIMETRES

      public static final String UNIT_CENTIMETRES
      A centimetre (international spelling) is a unit of length in the metric system, equal to one hundredth of a meter.
      Since:
      3.0.0
      See Also:
    • UNIT_METRES

      public static final String UNIT_METRES
      The metre (international spelling) is the base unit of length in the International System of Units (SI).
      Since:
      3.0.0
      See Also:
    • UNIT_KILOMETRES

      public static final String UNIT_KILOMETRES
      The kilometre (international spelling) is a unit of length in the metric system, equal to one thousand metres. It is now the measurement unit used officially for expressing distances between geographical places on land in most of the world; notable exceptions are the United States and the road network of the United Kingdom where the statute mile is the official unit used.
      Since:
      3.0.0
      See Also:
    • UNIT_DEFAULT

      public static final String UNIT_DEFAULT
      The default unit used in most Turf methods when no other unit is specified is kilometers.
      Since:
      1.2.0
      See Also: