Class TurfAssertions

java.lang.Object
com.mapbox.turf.TurfAssertions

public final class TurfAssertions extends Object
Also called Assertions, these methods enforce expectations of a certain type or calculate various shapes from given points.
Since:
1.2.0
See Also:
  • Method Details

    • getCoord

      @Deprecated public static com.mapbox.geojson.Point getCoord(com.mapbox.geojson.Feature obj)
      Unwrap a coordinate Point from a Feature with a Point geometry.
      Parameters:
      obj - any value
      Returns:
      a coordinate
      Since:
      1.2.0
      See Also:
    • geojsonType

      public static void geojsonType(com.mapbox.geojson.GeoJson value, String type, String name)
      Enforce expectations about types of GeoJson objects for Turf.
      Parameters:
      value - any GeoJson object
      type - expected GeoJson type
      name - name of calling function
      Since:
      1.2.0
      See Also:
    • featureOf

      public static void featureOf(com.mapbox.geojson.Feature feature, String type, String name)
      Enforce expectations about types of Feature inputs for Turf. Internally this uses Feature.type() to judge geometry types.
      Parameters:
      feature - with an expected geometry type
      type - type expected GeoJson type
      name - name of calling function
      Since:
      1.2.0
      See Also:
    • collectionOf

      public static void collectionOf(com.mapbox.geojson.FeatureCollection featureCollection, String type, String name)
      Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses Feature.type()} to judge geometry types.
      Parameters:
      featureCollection - for which features will be judged
      type - expected GeoJson type
      name - name of calling function
      Since:
      1.2.0
      See Also: