dissolve
描述
🌐 Description
溶解一个经过可选属性名称:值筛选的 Polygon 特性集合。请注意,集合中的 MultiPolygon 特性不受支持
🌐 Dissolves a FeatureCollection of Polygon features, filtered by an optional property name:value. Note that MultiPolygon features within the collection are not supported
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| fc | FeatureCollection<Polygon> | |
| options? | Object | 可选参数 (默认 {}) |
| options.propertyName? | string | 具有相同 propertyName 值的要素将被合并。 |
| featureCollection | FeatureCollection<Polygon> | 要被合并的输入要素集合 |
返回
🌐 Returns
FeatureCollection<Polygon> 一个包含融合多边形的要素集合
示例
🌐 Examples
var features = turf.featureCollection([
turf.polygon(
[
[
[0, 0],
[0, 1],
[1, 1],
[1, 0],
[0, 0],
],
],
{ combine: "yes" },
),
turf.polygon(
[
[
[0, -1],
[0, 0],
[1, 0],
[1, -1],
[0, -1],
],
],
{ combine: "yes" },
),
turf.polygon(
[
[
[1, -1],
[1, 0],
[2, 0],
[2, -1],
[1, -1],
],
],
{ combine: "no" },
),
]);
var dissolved = turf.dissolve(features, { propertyName: "combine" });
安装
🌐 Installation
$ npm install @turf/dissolve
import { dissolve } from "@turf/dissolve";
const result = dissolve(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.dissolve(...);