Package com.mapbox.turf
Class TurfJoins
java.lang.Object
com.mapbox.turf.TurfJoins
Class contains methods that can determine if points lie within a polygon or not.
- Since:
- 1.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleaninside(com.mapbox.geojson.Point point, com.mapbox.geojson.MultiPolygon multiPolygon) Takes aPointand aMultiPolygonand determines if the point resides inside the polygon.static booleaninside(com.mapbox.geojson.Point point, com.mapbox.geojson.Polygon polygon) Takes aPointand aPolygonand determines if the point resides inside the polygon.static com.mapbox.geojson.FeatureCollectionpointsWithinPolygon(com.mapbox.geojson.FeatureCollection points, com.mapbox.geojson.FeatureCollection polygons) Takes aFeatureCollectionofPointand aFeatureCollectionofPolygonand returns the points that fall within the polygons.
-
Method Details
-
inside
public static boolean inside(com.mapbox.geojson.Point point, com.mapbox.geojson.Polygon polygon) Takes aPointand aPolygonand 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 polygonpolygon- 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 aPointand aMultiPolygonand 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 polygonmultiPolygon- 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 aFeatureCollectionofPointand aFeatureCollectionofPolygonand 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
-