Class TurfMeta

java.lang.Object
com.mapbox.turf.TurfMeta

public final class TurfMeta extends Object
Class contains methods that are useful for getting all coordinates from a specific GeoJson geometry.
Since:
2.0.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.FeatureCollection featureCollection, boolean excludeWrapCoord)
    Get all coordinates from a FeatureCollection object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.Feature feature, boolean excludeWrapCoord)
    Get all coordinates from a Feature object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.LineString lineString)
    Get all coordinates from a LineString object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.MultiLineString multiLineString)
    Get all coordinates from a MultiLineString object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.MultiPoint multiPoint)
    Get all coordinates from a MultiPoint object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.MultiPolygon multiPolygon, boolean excludeWrapCoord)
    Get all coordinates from a MultiPolygon object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.Point point)
    Get all coordinates from a Point object, returning a List of Point objects.
    static List<com.mapbox.geojson.Point>
    coordAll(com.mapbox.geojson.Polygon polygon, boolean excludeWrapCoord)
    Get all coordinates from a Polygon object, returning a List of Point objects.
    static com.mapbox.geojson.Point
    getCoord(com.mapbox.geojson.Feature obj)
    Unwrap a coordinate Point from a Feature with a Point geometry.

    Methods inherited from class java.lang.Object

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

    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Point point)
      Get all coordinates from a Point object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      point - any Point object
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiPoint multiPoint)
      Get all coordinates from a MultiPoint object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      multiPoint - any MultiPoint object
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.LineString lineString)
      Get all coordinates from a LineString object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      lineString - any LineString object
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Polygon polygon, @NonNull boolean excludeWrapCoord)
      Get all coordinates from a Polygon object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      polygon - any Polygon object
      excludeWrapCoord - whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiLineString multiLineString)
      Get all coordinates from a MultiLineString object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      multiLineString - any MultiLineString object
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.MultiPolygon multiPolygon, @NonNull boolean excludeWrapCoord)
      Get all coordinates from a MultiPolygon object, returning a List of Point objects. If you have a geometry collection, you need to break it down to individual geometry objects before using coordAll(com.mapbox.geojson.Point).
      Parameters:
      multiPolygon - any MultiPolygon object
      excludeWrapCoord - whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used to handle Polygon and MultiPolygon geometries.
      Returns:
      a List made up of Points
      Since:
      2.0.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.Feature feature, @NonNull boolean excludeWrapCoord)
      Get all coordinates from a Feature object, returning a List of Point objects.
      Parameters:
      feature - the Feature that you'd like to extract the Points from.
      excludeWrapCoord - whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used if the Feature passed through the method is a Polygon or MultiPolygon geometry.
      Returns:
      a List made up of Points
      Since:
      4.8.0
    • coordAll

      @NonNull public static List<com.mapbox.geojson.Point> coordAll(@NonNull com.mapbox.geojson.FeatureCollection featureCollection, @NonNull boolean excludeWrapCoord)
      Get all coordinates from a FeatureCollection object, returning a List of Point objects.
      Parameters:
      featureCollection - the FeatureCollection that you'd like to extract the Points from.
      excludeWrapCoord - whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. Used if a Feature in the FeatureCollection that's passed through this method, is a Polygon or MultiPolygon geometry.
      Returns:
      a List made up of Points
      Since:
      4.8.0
    • getCoord

      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:
      3.2.0
      See Also: