Skip to content
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

ENH: vectorized function to force orientation of polygon rings #1366

Open
jorisvandenbossche opened this issue Apr 15, 2022 · 4 comments · May be fixed by #1690
Open

ENH: vectorized function to force orientation of polygon rings #1366

jorisvandenbossche opened this issue Apr 15, 2022 · 4 comments · May be fixed by #1690

Comments

@jorisvandenbossche
Copy link
Member

Similar as pygeos/pygeos#71

Shapely has a custom function to force the orientation of a geometry: shapely.ops.orient (impl. But, this is currently a pure python function. Because this is not something that is supported by GEOS out of the box, this is also not supported by a vectorized ufunc that were merged from pygeos.

It would be good to add a vectorized ufunc version of orient.

As reference, PostGIS has ST_ForcePolygonCCW and related functions.

@dr-jts
Copy link

dr-jts commented May 12, 2022

Feel free to file a GEOS issue to request this. Perhaps a function GEOSOrientPolygon(Geometry, boolean isCW), to allow orienting either shell-CW (the GEOS default) or shell-CCW.

Note that GEOSNormalize doesn't really provide all this, since (a) it always orients shell-CW (which seems to be not what is wanted nowadays) and (b) it can rotate rings (which is a bigger change than just reorienting them).

@idanmiara
Copy link
Contributor

Until a more optimized solution is proposed (ufunc, geos, etc...):
#1690 could be an alternative solution.

@jorisvandenbossche
Copy link
Member Author

Opened libgeos/geos#779 to track this upstream in GEOS

@idanmiara
Copy link
Contributor

idanmiara commented Jan 1, 2023

Please see new implementation for force_ccw in #1690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants