开发者社区> 镜像站> NPM> turf-merge
turf-merge

merge polygons

turf-merge is deprecated in favor of using turf-union for cascading unions
Last updated 6 years ago by morganherlocker .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-merge 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.2                                ...           latest (6 years ago)

6 Versions

  • 1.0.2 [deprecated]           ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Downloads
Today 0
This Week 12
This Month 12
Last Day 0
Last Week 0
Last Month 4
Dependencies (2)
Dev Dependencies (5)