Class TurfTransformation

java.lang.Object
com.mapbox.turf.TurfTransformation

public final class TurfTransformation extends Object
Methods in this class consume one GeoJSON object and output a new object with the defined parameters provided.
Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.mapbox.geojson.Polygon
    circle(com.mapbox.geojson.Point center, double radius)
    Takes a Point and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.
    static com.mapbox.geojson.Polygon
    circle(com.mapbox.geojson.Point center, double radius, int steps, String units)
    Takes a Point and calculates the circle polygon given a radius in the provided TurfConstants.TurfUnitCriteria; and steps for precision.
    static com.mapbox.geojson.Polygon
    circle(com.mapbox.geojson.Point center, double radius, String units)
    Takes a Point and calculates the circle polygon given a radius in the provided TurfConstants.TurfUnitCriteria; and steps for precision.

    Methods inherited from class java.lang.Object

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

    • circle

      public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius)
      Takes a Point and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision. This uses the DEFAULT_STEPS and TurfConstants.UNIT_DEFAULT values.
      Parameters:
      center - a Point which the circle will center around
      radius - the radius of the circle
      Returns:
      a Polygon which represents the newly created circle
      Since:
      3.0.0
    • circle

      public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius, String units)
      Takes a Point and calculates the circle polygon given a radius in the provided TurfConstants.TurfUnitCriteria; and steps for precision. This method uses the DEFAULT_STEPS.
      Parameters:
      center - a Point which the circle will center around
      radius - the radius of the circle
      units - one of the units found inside TurfConstants.TurfUnitCriteria
      Returns:
      a Polygon which represents the newly created circle
      Since:
      3.0.0
    • circle

      public static com.mapbox.geojson.Polygon circle(@NonNull com.mapbox.geojson.Point center, double radius, int steps, String units)
      Takes a Point and calculates the circle polygon given a radius in the provided TurfConstants.TurfUnitCriteria; and steps for precision.
      Parameters:
      center - a Point which the circle will center around
      radius - the radius of the circle
      steps - number of steps which make up the circle parameter
      units - one of the units found inside TurfConstants.TurfUnitCriteria
      Returns:
      a Polygon which represents the newly created circle
      Since:
      3.0.0