Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-kinks

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-kinks

turf kinks module

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-7.05%
Maintainers
1
Weekly downloads
 
Created
Source

turf-kinks

Build Status

Takes a polygon and detects all self-intersections.

Note: This module uses straight line intersections, so giant edges may not be computed correctly, since the curvature of the earth is not accounted for

Experimental: attempts to correct the kinks with reasonable assumptions

##Install

npm install turf-kinks

##Parameters

namedescription
polygonpolygon feature or geometry

##Usage

kinks(poly)

###Example

var kinks = require('turf-kinks')

var poly = {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -12.034835815429688,
              8.901183448260598
            ],
            [
              -12.060413360595701,
              8.899826693726117
            ],
            [
              -12.036380767822266,
              8.873199368734273
            ],
            [
              -12.059383392333983,
              8.871418491385919
            ],
            [
              -12.034835815429688,
              8.901183448260598
            ]
          ]
        ]
      }

  var result = kinks(poly)

  console.log(result)

  /*
  	{
  		intersections: {"type":"Feature","geometry":{"type":"Point","coordinates":[-12.047632938440815,8.885666404927512]},"properties":{}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-12.047632938440815,8.885666404927512]},"properties":{}}]
  	}
  */

Keywords

FAQs

Package last updated on 31 Dec 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