# booleanPointInPolygon

Takes a 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.

> npm install @turf/boolean-point-in-polygon


参数 类型 描述
point Coord input point
polygon Feature <(Polygon|MultiPolygon)> input polygon or multipolygon
options Object Optional parameters: see below


属性 类型 默认值 描述
ignoreBoundary boolean false True if polygon boundary should be ignored when determining if the point is inside the polygon otherwise false.


boolean - true if the Point is inside the Polygon; false if the Point is not inside the Polygon


var pt = turf.point([-77, 44]);
var poly = turf.polygon([[
  [-81, 41],
  [-81, 47],
  [-72, 47],
  [-72, 41],
  [-81, 41]

turf.booleanPointInPolygon(pt, poly);
//= true
Last Updated: 1/19/2021, 10:59:20 AM