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

turf-intersect

Package Overview
Dependencies
Maintainers
9
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-intersect - npm Package Compare versions

Comparing version 3.0.10 to 3.0.12

2

package.json
{
"name": "turf-intersect",
"version": "3.0.10",
"version": "3.0.12",
"description": "find the intersection of spatial features",

@@ -5,0 +5,0 @@ "main": "index.js",

# turf-intersect
[![build status](https://secure.travis-ci.org/Turfjs/turf-intersect.png)](http://travis-ci.org/Turfjs/turf-intersect)
# intersect
find the intersection of spatial features
Takes two [polygons](Polygon) and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined.
**Parameters**
### `turf.intersect(poly1, poly2)`
- `poly1` **Feature<Polygon>** the first polygon
- `poly2` **Feature<Polygon>** the second polygon
Takes two Polygon|polygons and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined.
**Examples**
### Parameters
| parameter | type | description |
| --------- | -------------------- | ------------------ |
| `poly1` | Feature\.\<Polygon\> | the first polygon |
| `poly2` | Feature\.\<Polygon\> | the second polygon |
### Example
```js
```javascript
var poly1 = {

@@ -72,9 +63,15 @@ "type": "Feature",

Returns **(Feature&lt;Polygon> | [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) | Feature&lt;MultiLineString>)** if `poly1` and `poly2` overlap, returns a Polygon feature representing the area they overlap; if `poly1` and `poly2` do not overlap, returns `undefined`; if `poly1` and `poly2` share a border, a MultiLineString of the locations where their borders are shared
**Returns** `Feature.<Polygon>,Feature.<MultiLineString>`, if `poly1` and `poly2` overlap, returns a Polygon feature representing the area they overlap; if `poly1` and `poly2` do not overlap, returns `undefined`; if `poly1` and `poly2` share a border, a MultiLineString of the locations where their borders are shared
---
## Installation
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
Requires [nodejs](http://nodejs.org/).
### Installation
Install this module individually:
```sh

@@ -84,8 +81,6 @@ $ npm install turf-intersect

## Tests
Or install the Turf module that includes it as a function:
```sh
$ npm test
$ npm install turf
```
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