#2287·turf

booleanPointInPolygon: ignoreBoundary option is ambiguous

Author: vahid18uCreated May 9, 2022Updated May 13, 2026
Labels@turf/boolean-point-in-polygon
  • turf version: 6.5.0

the result of the following code is false false while point (1.5,1.5) is mathematically on the boundary of the polygon.

javascript
const pt = turf.point([1.5, 1.5]);
    const poly = turf.polygon([[
      [0, 0],
      [1, 0],
      [2, 1],
      [1, 1],
      [0, 0],
    ]]);
    const a = turf.booleanPointInPolygon(pt, poly, { ignoreBoundary: true });
    const b = turf.booleanPointInPolygon(pt, poly, { ignoreBoundary: false });
    console.log(a);
    console.log(b);

I guess you mean something else by 'boundary' and perhaps you mean vertices defining the polygon. It sounds ambiguous by the way.

Capture