turf-union

WebJar for turf-union

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-union
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-union
WebJar for turf-union
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Turfjs/turf-union

Download turf-union

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-union/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-union</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-union/
implementation 'org.webjars.npm:turf-union:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-union/
implementation ("org.webjars.npm:turf-union:3.0.12")
'org.webjars.npm:turf-union:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-union" rev="3.0.12">
  <artifact name="turf-union" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-union', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-union" % "3.0.12"
[org.webjars.npm/turf-union "3.0.12"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : jsts jar [1.1.2]

Project Modules

There are no modules declared in this project.

DEPRECATED - replaced with @turf/union

turf-union

build status

find the union of geographic features

turf.union(poly1, poly2)

Takes two Polygon|polygons and returns a combined polygon. If the input polygons are not contiguous, this function returns a MultiPolygon feature.

Parameters

parameter type description
poly1 Feature.<Polygon> input polygon
poly2 Feature.<Polygon> another input polygon

Example

var poly1 = {
  "type": "Feature",
  "properties": {
    "fill": "#0f0"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-82.574787, 35.594087],
      [-82.574787, 35.615581],
      [-82.545261, 35.615581],
      [-82.545261, 35.594087],
      [-82.574787, 35.594087]
    ]]
  }
};
var poly2 = {
  "type": "Feature",
  "properties": {
    "fill": "#00f"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-82.560024, 35.585153],
      [-82.560024, 35.602602],
      [-82.52964, 35.602602],
      [-82.52964, 35.585153],
      [-82.560024, 35.585153]
    ]]
  }
};
var polygons = {
  "type": "FeatureCollection",
  "features": [poly1, poly2]
};

var union = turf.union(poly1, poly2);

//=polygons

//=union

Returns Feature.<Polygon|MultiPolygon>, a combined Polygon or MultiPolygon feature

Installation

Requires nodejs.

$ npm install turf-union

Tests

$ npm test
org.webjars.npm

turf

a fast and fully featured open gis engine written in javascript

Versions

Version
3.0.12