mapbox / geojsonhint

IMPORTANT: This repo will be archived. Use @placemarkio/check-geojson instead
ISC License
258 stars 37 forks source link

fix RHR logic #55

Closed perrygeo closed 7 years ago

perrygeo commented 7 years ago

resolves #54

My previous code in rhr.js was the opposite of the right hand rule. 😬 . Apologies. This PR fixes the logic and updates the test fixtures accordingly.

In some cases where the coordinates were invalid, I made the decision to not even run the rightHandRule test. (e.g. If you have a polygon with coordinates [[5]], the return value of rightHandRule is meaningless).

cc @tmcw @tyrasd

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling f9e2cc9afae966171ef15750518e7fa3cf35354f on correct-rhr into 691033b0a959938d26fa0ccaa301e270e07c001b on master.