phayes / geoPHP

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

output GeoJSON not valid (right hand rule) #157

Open radiallogic opened 5 years ago

radiallogic commented 5 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.