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

Difference: Polygons exterior ring has a wrong position. #91

Open
ilijaz opened this issue Sep 7, 2018 · 1 comment
Open

Difference: Polygons exterior ring has a wrong position. #91

ilijaz opened this issue Sep 7, 2018 · 1 comment

Comments

@ilijaz
Copy link

ilijaz commented Sep 7, 2018

After running intersection operation, result has had a negative area -9069.92444862902 which was calculated with turf.area. If you look at the result polygon you can see that second Polygon in MultiPolygon has the wrong position of the exterior ring.
https://codepen.io/ilijaz/pen/NLwvxN

turf.area(turf.polygon([inter.geometry.coordinates[1][0]]))
1023.8113326824149
turf.area(turf.polygon([inter.geometry.coordinates[1][1]]))
8.098257462853686
turf.area(turf.polygon([inter.geometry.coordinates[1][2]]))
9603.9065415225

So the standart says:

For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.

Is it possible to sort rings in polygon after clipping?

PS. All works fine with QGIS and Leaflet.

@rowanwins
Copy link
Collaborator

Appears to be resolved in 0.7.3

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

No branches or pull requests

3 participants