phayes / geoPHP

Advanced geometry operations in PHP
https://geophp.net
Other
865 stars 265 forks source link

output GeoJSON not valid (right hand rule) #157

Open radiallogic opened 6 years ago

radiallogic commented 6 years ago

If you import data from WKB format and then export it as geoJSON. The geoJSON isn't valid if the right hand rule is not met. Since 2016 geoJSON is a formal IETF specification and it requires the right hand rule to be valid.

The spec for the right hand rule is:

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.