-
Notifications
You must be signed in to change notification settings - Fork 33
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
PointInPolygon#choose_good_ray is too slow #5
Comments
Hey there! That's great, could you prepare some sample benchmarks please? |
Oh sorry about confusing phrase. When I run with Let me find some example points and create a benchmark script. |
Gist created: |
Hi, I read your gist, thanks a lot for it. The main reason why we have to run If you really need to increase performance of this method, you should choose other ways. For instance,
But in fact if the tracing ray is parallel to some edge, it is fine. The problem is when the tracing ray includes an edge completely. Thanks, |
If I only remove edges.none? { |edge| edge.parallel_to?(ray) } from |
I have modified
PointInPolygon#point_location
to userandom_ray
directly insteadThen it becomes very fast for me
And the result is acceptable too (observed on a map with markers and polygons)
So I wonder if it's possible to add an option to pass when calculating
I might make a PR later
The text was updated successfully, but these errors were encountered: