-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to check or correct the "orient" of polygons #71
Comments
Postgis also has a set of methods related to this: |
Possible related to this is also GEOSNormalize_r (https://postgis.net/docs/ST_Normalize.html) |
#126 --> implement |
It's potentially a bit more than just |
Ok sorry I was a bit fast closing this then. Let’s investigate! |
I opened an equivalent function in Shapely: shapely/shapely#1366, so let's close here. |
Shapely has a
orient
function to make a copy of a Polygon with "proper" orientation of the rings: https://shapely.readthedocs.io/en/latest/manual.html#shapely.geometry.polygon.orient (definition in the code: https://github.com/Toblerity/Shapely/blob/b21a964a56a86cf77c67b477db7e7c2e81d2ccb5/shapely/geometry/polygon.py#L391-L404)In addition, Shapely also has a
is_ccw
(is counter clock wise) attribute on LinearRings: https://shapely.readthedocs.io/en/latest/manual.html#object.is_ccwFor this, there is a GEOS C API function: https://github.com/libgeos/geos/blob/eb4da1440836fedf503e1eb2c245595a0f33db5e/capi/geos_c.h.in#L351-L357 (although Shapely implements it manually by calculating the signed area)
The text was updated successfully, but these errors were encountered: