turf-intersect
Advanced tools
Comparing version 3.0.10 to 3.0.12
{ | ||
"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<Polygon> | [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) | 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 | ||
**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 | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5867
85