# geojson-rewind

> enforce winding order for geojson

Latest version **0.3.1** (published 2018-03-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install geojson-rewind
pnpm add geojson-rewind
yarn add geojson-rewind
bun add geojson-rewind
```

Provides the command `geojson-rewind`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2018-03-09 |
| First published | 2013-12-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 133 |
| Author | Tom MacWright |
| Maintainers | ingalls, mapbox-admin, tmcw |
| Keywords | geojson, winding, order, rendering, coordinates |

## Links

- npm: https://www.npmjs.com/package/geojson-rewind
- Repository: https://github.com/mapbox/geojson-rewind
- Issues: https://github.com/mapbox/geojson-rewind/issues
- npm.io page: https://npm.io/package/geojson-rewind

## Dependencies (4)

- [minimist](https://npm.io/package/minimist.md) 1.2.0
- [sharkdown](https://npm.io/package/sharkdown.md) ^0.1.0
- [concat-stream](https://npm.io/package/concat-stream.md) ~1.6.0
- [@mapbox/geojson-area](https://npm.io/package/@mapbox/geojson-area.md) 0.2.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.3.1 (latest) — 2018-03-09
- 0.3.0 — 2017-09-21
- 0.2.0 — 2016-05-05
- 0.1.0 — 2013-12-16
- 0.0.0 — 2013-12-16

## README

[![Build Status](https://travis-ci.org/mapbox/geojson-rewind.png)](https://travis-ci.org/mapbox/geojson-rewind)

# geojson-rewind

The [GeoJSON](https://tools.ietf.org/html/rfc7946) specification is [picky about winding order](https://tools.ietf.org/html/rfc7946#section-3.1.6).

This helps you generate compliant Polygon and MultiPolygon geometries. Furthermore it lets you use [Canvas](http://www.bit-101.com/blog/?p=3702) and other drawing libraries's default behavior to color the interior rings of Polygon and MultiPolygon features.

## usage

as npm module:

    npm install --save geojson-rewind

as console utility

    # install
    npm install -g geojson-rewind
    # use
    geojson-rewind foo.geojson

as browser library

copy `geojson-rewind.js`

## api

`rewind(geojson, clockwise)`

Given a GeoJSON FeatureCollection, Feature, or Geometry, return a version
with inner and outer rings of different winding orders.

If `clockwise` is `true`, the outer ring is clockwise, otherwise
it is counterclockwise.

---
_Source: https://npm.io/package/geojson-rewind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
