-
Notifications
You must be signed in to change notification settings - Fork 560
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
Feat: Vectorized orient function #1684
Comments
Hi @kylebarron |
It looks like import shapely
xmin = [0, 1]
ymin = [3, 4]
xmax = [5, 6]
ymax = [7, 8]
geoms = shapely.box(xmin, ymin, xmax, ymax, ccw=False)
big_geoms = list(geoms) * 1000
%timeit shapely.ops.orient(big_geoms)
# 313 ns ± 7.58 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
%timeit [shapely.ops.orient(geom) for geom in big_geoms]
# 244 ms ± 4.66 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) I didn't know |
orient
functionorient
function moved to shapely.ops.orient
Nope. It's just returns the original geom since it's not supported. just try your original test on it.
There are many duplicated functions from in shapely 2 with fragmented documentation. |
Oh that seems really bad: it's silently returning results with no indication that the orient didn't happen |
orient
function moved to shapely.ops.orient
I think that the idea was that if the input is not With #1690 it works also for geometry array. |
Yes, the existing Existing issue about providing a vectorized version of this: #1366 |
Duplicate of #1366 |
@kylebarron |
Expected behavior and actual behavior.
It looks like the
shapely.geometry.polygon.orient
function is not yet vectorized and only works with a single polygon objectSteps to reproduce the problem.
Operating system
MacOS
Shapely version and provenance
2.0.0 from pip
The text was updated successfully, but these errors were encountered: