| 1234567891011121314151617181920212223242526 |
- import { Geometry, Feature, FeatureCollection } from 'geojson';
- import { AllGeoJSON } from '@turf/helpers';
- /**
- * Rewind {@link LineString|(Multi)LineString} or {@link Polygon|(Multi)Polygon} outer ring counterclockwise and inner rings clockwise (Uses {@link http://en.wikipedia.org/wiki/Shoelace_formula|Shoelace Formula}).
- *
- * @function
- * @param {GeoJSON} geojson input GeoJSON Polygon
- * @param {Object} [options={}] Optional parameters
- * @param {boolean} [options.reverse=false] enable reverse winding
- * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)
- * @returns {GeoJSON} rewind Polygon
- * @example
- * var polygon = turf.polygon([[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]);
- *
- * var rewind = turf.rewind(polygon);
- *
- * //addToMap
- * var addToMap = [rewind];
- */
- declare function rewind<T extends AllGeoJSON>(geojson: T, options?: {
- reverse?: boolean;
- mutate?: boolean;
- }): Geometry | Feature | FeatureCollection;
- export { rewind as default, rewind };
|