JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 160
  • Score
    100M100P100Q11183F
  • License ISC

merge polygons

Package Exports

  • turf-merge

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turf-merge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

turf-merge

build status

merge polygons

turf.merge(fc)

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

Parameters

parameter type description
fc FeatureCollection - 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