Booleans

boolean-point-in-polygon

turf.boolean_point_in_polygon(point: Union[Sequence, Dict, turf.helpers._features.Feature], polygon: Union[Dict, turf.helpers._features.Feature], options: Dict = None)[source]

Takes a {@link Point} and a Polygon or MultiPolygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.

reference:

http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule modified from: https://github.com/substack/point-in-polygon/blob/master/index.js which was modified from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

Parameters
  • point – input Point Feature

  • polygon – input Polygon or MultiPolygon Feature

  • options

    optional parameters [options[“ignoreBoundary”]] True if polygon boundary should be ignored when determining if

    the point is inside the polygon otherwise False.

Returns

True if the Point is inside the Polygon; False otherwise

boolean-point-on-line

turf.boolean_point_on_line(point: PointFeature, line: LineFeature, options: Dict = {})bool[source]

Returns True if a point is on a line else False. Accepts a optional parameter to ignore the start and end vertices of the linestring.

Parameters
  • point – {Point} GeoJSON Point

  • line – {LineString} GeoJSON LineString

  • options – Optional parameters [options[“ignoreEndVertices”]=False] whether to ignore the start and end vertices

Returns

boolean True/False if point is on line