Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turf.buffer creates Polygons with clockwise vertices. #35

Open
devdattaT opened this issue Dec 6, 2016 · 0 comments
Open

turf.buffer creates Polygons with clockwise vertices. #35

devdattaT opened this issue Dec 6, 2016 · 0 comments

Comments

@devdattaT
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant