First pass at creating correctly-oriented polygons.
See #53
@frewsxcv I've had to rename the geo-types feature to geotypes in order to set up multiple crates as a feature (AFAIK you can only use a crate name as a feature name for a single crate). Lmk if there's a better / non-breaking way to accomplish it…
From the GeoJSON spec:
o 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.
Note: the [GJ2008] specification did not discuss linear ring winding
order. For backwards compatibility, parsers SHOULD NOT reject
Polygons that do not follow the right-hand rule.
I'm having a little trouble comprehending this, but it to me it sounds like:
- When reading GeoJSON, allow clockwise or counterclockwise linear rings
- When writing GeoJSON, output counterclockwise exterior linear rings, clockwise interior rings
Does that sound right? 🤔
Also, separate thought, but instead of pulling in the entire geo crate, we do have the ability to just add a geo-winding-order crate as a dependency. Just an idea!
Does that sound right? 🤔
Yep, that's my understanding! Good idea on the winding-order crate if it gives us a compilation speedup…
Does that sound right? 🤔
Yep, that's my understanding! Good idea on the winding-order crate if it gives us a compilation speedup…
So considering we'll need to potentially reverse the orientation of linear rings when reading and writing GeoJSON, it seems like we'll need to make a dependency on geo (or geo-winding-order) regardless of whether they have geotypes feature enabled.