Class TurfJoins

java.lang.Object
com.mapbox.turf.TurfJoins

public final class TurfJoins extends Object
Class contains methods that can determine if points lie within a polygon or not.
Since:
1.3.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    inside(com.mapbox.geojson.Point point, com.mapbox.geojson.MultiPolygon multiPolygon)
    Takes a Point and a MultiPolygon and determines if the point resides inside the polygon.
    static boolean
    inside(com.mapbox.geojson.Point point, com.mapbox.geojson.Polygon polygon)
    Takes a Point and a Polygon and determines if the point resides inside the polygon.
    static com.mapbox.geojson.FeatureCollection
    pointsWithinPolygon(com.mapbox.geojson.FeatureCollection points, com.mapbox.geojson.FeatureCollection polygons)
    Takes a FeatureCollection of Point and a FeatureCollection of Polygon and returns the points that fall within the polygons.

    Methods inherited from class java.lang.Object

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

    • inside

      public static boolean inside(com.mapbox.geojson.Point point, com.mapbox.geojson.Polygon polygon)
      Takes a Point and a Polygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.
      Parameters:
      point - which you'd like to check if inside the polygon
      polygon - which you'd like to check if the points inside
      Returns:
      true if the Point is inside the Polygon; false if the Point is not inside the Polygon
      Since:
      1.3.0
      See Also:
    • inside

      public static boolean inside(com.mapbox.geojson.Point point, com.mapbox.geojson.MultiPolygon multiPolygon)
      Takes a Point and a MultiPolygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.
      Parameters:
      point - which you'd like to check if inside the polygon
      multiPolygon - which you'd like to check if the points inside
      Returns:
      true if the Point is inside the MultiPolygon; false if the Point is not inside the MultiPolygon
      Since:
      1.3.0
      See Also:
    • pointsWithinPolygon

      public static com.mapbox.geojson.FeatureCollection pointsWithinPolygon(com.mapbox.geojson.FeatureCollection points, com.mapbox.geojson.FeatureCollection polygons)
      Takes a FeatureCollection of Point and a FeatureCollection of Polygon and returns the points that fall within the polygons.
      Parameters:
      points - input points.
      polygons - input polygons.
      Returns:
      points that land within at least one polygon.
      Since:
      1.3.0