# polygonToLine

Converts a Polygon to (Multi)LineString or MultiPolygon to a FeatureCollection of (Multi)LineString.
将多边形转换为(多)LineString或将MultiPolygon转换为(多)LineStringFeatureCollection

参数

参数 类型 描述
polygon Feature <(Polygon|MultiPolygon)> Feature to convert
options Object Optional parameters: see below

options选项

属性 类型 默认值 描述
properties Object {} translates GeoJSON properties to Feature

返回

(FeatureCollection|Feature <(LineString|MultiLinestring)>) - converted (Multi)Polygon to (Multi)LineString

示例

var poly = turf.polygon([[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]);

var line = turf.polygonToLine(poly);
Last Updated: 1/19/2021, 10:59:20 AM