-
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: Optimize z property of point #2032
base: main
Are you sure you want to change the base?
Conversation
With upcoming development for shapely 2.1 with GEOS 3.12+ the third coordinate (i.e. Or, possibly |
Interesting. well I think i actually just found an approach that is even faster if you are open to it? Basically it still uses get_z, but it skips the has_z. as get_z does that for us by returning nan. It's a bit faster. Getting 3.1s I also realized my numbers for get_z above were incorrect. it is in the 5s, not the 10. Not sure what happened there. |
Intriguing that One surprise that I don't see from the existing tests is that newer GEOS versions allow NaN as valid coordinate values, i.e.:
which means this geometry should continue to allow access to |
Pull Request Test Coverage Report for Build 8667800059Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Yeah, depending on how the Point is created, it "knows" its dimension, and it has stored whether it has a z coord in That means that with recent GEOS, you can explicitly create a 3D POINTZ ( |
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Slightly based off of conversation here: #1995
I noticed that getting .z was incredibly slow compared to get_coordinates.
This refactors .z to be significantly faster.
My test:
edit: Removed old comparisions
Nightly comparision:
Old: 4.941876173019409
New:3.2745301723480225