Socket
Socket
Sign inDemoInstall

turf-inside

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-inside

turf inside module


Version published
Weekly downloads
13K
increased by5.08%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 16 Oct 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc