Skip to main content
Version: 7.2.0

dissolve

描述

¥Description

分解 多边形 要素的 FeatureCollection,并通过可选属性 name:value 进行过滤。请注意,不支持集合中的 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

名称类型描述
fcFeatureCollection<多边形>
options?对象可选参数(默认 {})
options.propertyName?string具有相同 propertyName 值的特性将被分解。
featureCollectionFeatureCollection<多边形>输入待融合的要素集合

返回

¥Returns

FeatureCollection<多边形> 包含已分解多边形的 FeatureCollection

¥FeatureCollection<Polygon> a FeatureCollection containing the dissolved polygons

示例

¥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(...);