Atlaslog
Atlaslog / Turf.js / API / booleanPointInPolygon
Turf.js · API reference

booleanPointInPolygon

Quick answer

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

Last verified 2026-11-03 · Turf.js 7.x · Cite this page
Runnable examplesChinese noteAll API topics

Description​

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.

Parameters​

NameTypeDescription
pointCoordinput point
polygonFeature<Polygon | MultiPolygon>input polygon or multipolygon
options?ObjectOptional parameters (default {})
options.ignoreBoundary?booleanTrue if polygon boundary should be ignored when determining if the point is inside the polygon otherwise false. (default false)

Returns​

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

Examples​

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

Installation​

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

import { booleanPointInPolygon } from "@turf/boolean-point-in-polygon";
const result = booleanPointInPolygon(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.booleanPointInPolygon(...);
TutorialsAPI index
English reference text adapted from the official Turf.js documentation, © Turf.js contributors, licensed under MIT.
Original page: https://turfjs.org/docs/api/booleanPointInPolygon · Chinese note: /turf/api/boolean-point-in-polygon.html
Cite this page

Atlaslog (2026). booleanPointInPolygon. https://www.jingweizhi.com/en/turf/api/boolean-point-in-polygon.html (accessed 2026-11-03).