Skip to content

turf.buffer creates Polygons with clockwise vertices. #35

@devdattaT

Description

@devdattaT

I'm using the CDN version of turf in my browser, and creating buffers for User provided points, and saving them in the db; I realized that the geojson created was not conforming to the GeoJSON standard, (section 3.16) specifically, which states that

A linear ring MUST follow the right-hand rule with respect to the
area it bounds, i.e., exterior rings are counterclockwise, and
holes are clockwise.

This can be replicated by running the following code:

var pt=turf.point([73,20]);
var buff=turf.buffer(pt, 2000, 'meters');
console.log(JSON.stringify(buff));

And then testing the output with http://geojsonlint.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions