# rewind

Rewind (Multi)LineString or (Multi)Polygon outer ring counterclockwise and inner rings clockwise (Uses Shoelace Formula ).
LineStringPolygon外圈逆时针倒带,内圈顺时针倒带(Shoelace formula公式)。

参数

参数 类型 描述
geojson GeoJSON input GeoJSON Polygon
options Object Optional parameters: see below

options选项

属性 类型 默认值 描述
reverse boolean false enable reverse winding
mutate boolean false allows GeoJSON input to be mutated (significant performance increase if true)

返回

GeoJSON - rewind Polygon

示例

var polygon = turf.polygon([[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]);

var rewind = turf.rewind(polygon);
Last Updated: 1/19/2021, 10:59:20 AM