Closed anthonynorth closed 1 year ago
Sorry for letting this sit for a while!
You probably already know that that winding order can be obtained from the signed area (e.g., https://dewey.dunnington.ca/post/2021/wk-version-0.5.0/#dplyr-integration ). You could in theory write a "filter" that accomplishes this...one of the reasons I never got here is that "filters" are hard and perhaps not as well thought-out as readers/writers. It's probably easier to write in C++ than in C (e.g., start from the WKT writer).
Would you be open to adding support for computing polygon orientation and re-orienting polygon features?
I'm aware of 2 packages which implement this:
sf::st_sfc(check_ring_dir=TRUE)
(requires all polygon/multipolygon, sets counterclockwise winding) andlwgeom::st_force_polygon_cw()
(clockwise winding). So this is not strictly necessary, but it would be convenient to not require the following back-and-forth:The current geoparquet spec has optional metadata for orientation, so it would be handy to have this facility for known polygon winding in geoparquet files written by {geoarrow}.