-
Notifications
You must be signed in to change notification settings - Fork 9
Tree acceleration for point-in-polygon #340
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
base: main
Are you sure you want to change the base?
Conversation
… polygon This still has one Core.Box that I cant seem to get rid of...
It's cheap and we should be doing it. Especially because it _really_ helps us going forward.
|
So the problem here is the same polygon type issue we ran into earlier. Everything has to be This sucks but it's the easiest way forward. |
| p_start = p_end | ||
| end | ||
|
|
||
| result = SpatialTreeInterface.depth_first_search(per_edge_function,extent -> extent.Y[1] <= y <= extent.Y[2], tree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second function could be defined above too this is hard to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...I might move the internal Hao Sun logic out since it's shared between the tree accelerated and nonaccelerated functions.
| if !((v1 < 0 && v2 < 0) || (v1 > 0 && v2 > 0)) # if not cases 11 or 26 | ||
| u1, u2 = GI.x(p_start) - x, GI.x(p_end) - x | ||
| f = Predicates.orient(p_start, p_end, (x, y); exact) | ||
| if v2 > 0 && v1 ≤ 0 # Case 3, 9, 16, 21, 13, or 24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wants a little comment giving context to the case numbers
|
There could be two reasons for the extra overhead:
|
This still has one Core.Box that I cant seem to get rid of...but is otherwise fully type stable
Benchmarks
Current naive Hao-Sun
Prepared with natural tree and using STI
36x speedup!
Target: TGGeometry
Benchmarking script