Non-Partisan Magicians

    @spatial/rewind
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    @spatial/rewind

    rewind

    Rewind (Multi)LineString or (Multi)Polygon outer ring counterclockwise and inner rings clockwise (Uses Shoelace Formula).

    Parameters

    • geojson GeoJSON input GeoJSON Polygon
    • options Object Optional parameters (optional, default {})
      • options.reverse boolean enable reverse winding (optional, default false)
      • options.mutate boolean allows GeoJSON input to be mutated (significant performance increase if true) (optional, default false)

    Examples

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

    Returns GeoJSON rewind Polygon


    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 @spatial/rewind

    Or install the Turf module that includes it as a function:

    $ npm install @turf/turf

    Install

    npm i @spatial/rewind

    DownloadsWeekly Downloads

    6

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    18.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • normanbreau
    • tpnormanbreau