-
Notifications
You must be signed in to change notification settings - Fork 557
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:force_ccw
: generalized vectorized shapely.ops.orient
; is_ccw
: add fallback for GEOS < 3.7
#1690
base: main
Are you sure you want to change the base?
Conversation
I'm wondering if I could generalize the decorator to work on any object type, not just on Geometry. |
2b3035b
to
7fa0a9e
Compare
84a40ae
to
25ecf79
Compare
What would be the goal / use case of that? In general, I am not sure if it is needed to already generalize this with a decorator, if we for now only have one place where we use this (and as long as we don't have plans to use it elsewhere as well). Some other thoughts:
|
Pull Request Test Coverage Report for Build 4026379876
💛 - Coveralls |
No specific other use case at the moment, just thought it would be a cleaner solution.
I think that could be a nice, easy to implement vectorize method to other functions with a single geometry as the first argument (for example, all the functions in
I don't have an opinion about the naming of the function. If you want to pick one I'd be happy to put as a top level function and put it also under the old name.module for backwards compatibility.
Thanks! Unfortunately, currently I don't have the time to go into this. |
a80fdc3
to
7b79b44
Compare
shapely.ops.orient
force_polygon_ccw
: vectorized, generalized shapely.ops.orient
Done. |
7b79b44
to
f374e64
Compare
9e3169a
to
7a1c494
Compare
force_polygon_ccw
: vectorized, generalized shapely.ops.orient
force_ccw
: generalized vectorized shapely.ops.orient
; is_ccw
: add fallback for GEOS < 3.7
7a1c494
to
77bac7e
Compare
force_ccw
: generalized vectorized shapely.ops.orient
; is_ccw
: add fallback for GEOS < 3.7force_ccw
: generalized vectorized shapely.ops.orient
; is_ccw
: add fallback for GEOS < 3.7
43e7e06
to
cc9a552
Compare
I've further improved The new If you approve these additions but require smaller PRs for review I could split this PR. |
cc9a552
to
7256959
Compare
Thanks for further working on this!
In general, I think we shouldn't bother too much with custom code to support such an old GEOS version. It's fine that some features just raise an error that the GEOS version is too old, and we are probably going to require GEOS 3.7 as a minimum version in the near future anyway (#1000)
No need to clean up commit histories, we squash on merge anyway. |
Thanks for your review :)
OK, Would you suggest I'll remove the fallback implementations for I think that till GEOS 3.7 is the minimum we could keep the
Yes for simple PRs I agree that that's the way to go. |
7256959
to
0cd4331
Compare
0cd4331
to
cb973f2
Compare
c750464
to
35017ef
Compare
@jorisvandenbossche I think I've fixed everything as per your comments |
35017ef
to
941f110
Compare
941f110
to
49afbc8
Compare
@jorisvandenbossche @kylebarron @brendan-ward I think this is ready for review. |
49afbc8
to
6d2350b
Compare
rebased to resolve conflicts with main |
ops.py, polygon.py - import improved `orient`, remove old implementation test_orient.py - add more tests `orient` now uses `is_ccw` which is available in GEOS>=3.7, thus marking tests accordingly
6d2350b
to
314b963
Compare
@jorisvandenbossche @kylebarron @brendan-ward |
@jorisvandenbossche any further thoughts about this PR? |
Closes #1366
Closes #1684
Closes #1696 (mostly)