1.0.2 • Published 9 years ago

turf-merge v1.0.2

Weekly downloads
1,592
License
ISC
Repository
github
Last release
9 years ago

turf-merge

build status

merge polygons

turf.merge(fc)

Takes a FeatureCollection of Polygon features and outputs a single merged polygon feature.

Parameters

parametertypedescription
fcFeatureCollection- a FeatureCollection of Polygon features

Example

var poly1 = turf.polygon([[
 [9.994812, 53.549487],
 [10.046997, 53.598209],
 [10.117721, 53.531737],
 [9.994812, 53.549487]
]]);
poly1.properties.fill = '#0f0';
var poly2 = turf.polygon([[
 [10.000991, 53.50418],
 [10.03807, 53.562539],
 [9.926834, 53.551731],
 [10.000991, 53.50418]
]]);
poly2.properties.fill = '#00f';

var polygons = turf.featurecollection([poly1, poly2]);

var merged = turf.merge(polygons);

//=polygons

//=merged

Installation

Requires nodejs.

$ npm install turf-merge

Tests

$ npm test
1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago