turf-inside
Checks to see if a point is inside of a polygon. The polygon can be convex or concave. The function accepts any valid polygon or multipolygon and accounts for holes.
###Install
npm install turf-inside
###Parameters
name | description |
---|
point | A Point Feature |
polygon | A Polygon or MultiPolygon Feature |
###Usage
inside(pt, poly)
###Example
var inside = require('turf-inside')
var point = require('turf-point')
var polygon = require('turf-polygon')
var poly = polygon([[[0,0], [50, 50], [0,100], [100,100], [100,0]]])
var pt = point(75, 75)
var isInside = inside(pt, poly)
console.log(isInside)