Package Exports
- @turf/rewind
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@turf/rewind) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@turf/rewind
rewind
Rewind (Mutli)LineString or (Multi)Polygon outer ring clockwise and inner rings counterclockwise (Uses Shoelace Formula).
Parameters
geojsonFeature<(Polygon | MultiPolygon | LineString | MultiLineString)> input GeoJSON Polygonreverse[Boolean] enable reverse winding (optional, defaultfalse)mutate[boolean] allows GeoJSON input to be mutated (significant performance increase if true) (optional, defaultfalse)
Examples
var polygon = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]
]
}
};
var rewind = turf.rewind(polygon);
//addToMap
var addToMap = [rewind];Returns Feature<(Polygon | MultiPolygon | LineString | MultiLineString)> rewind Polygon
rewindLineString
Rewind LineString - outer ring clockwise
Parameters
coordsArray<Array<number>> GeoJSON LineString geometry coordinatesreverse[Boolean] enable reverse winding (optional, defaultfalse)
Returns void mutates coordinates
rewindPolygon
Rewind Polygon - outer ring clockwise and inner rings counterclockwise.
Parameters
coordsArray<Array<Array<number>>> GeoJSON Polygon geometry coordinatesreverse[Boolean] enable reverse winding (optional, defaultfalse)
Returns void mutates coordinates
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/rewindOr install the Turf module that includes it as a function:
$ npm install @turf/turf