Socket
Socket
Sign inDemoInstall

turf-inside

Package Overview
Dependencies
1
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    turf-inside

turf inside module


Version published
Weekly downloads
14K
increased by10.39%
Maintainers
1
Install size
43.8 kB
Created
Weekly downloads
 

Readme

Source

turf-inside

Build Status

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

namedescription
pointA Point Feature
polygonA 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) // true

Keywords

FAQs

Last updated on 16 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc