-
Notifications
You must be signed in to change notification settings - Fork 154
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
[FEA] Nearest point and segment index of linestring to a point (pairwise) #646
Comments
To clarify, if a point is the same as a vertex, what's the result segment idx? |
I think that is easily answered by considering the cases where the point is the first point or the last point in the linestring. Based on that, I think this is a good answer:
Where So if we have 5 points and 4 segments in a linestring:
|
Another clarification: should the function handle multi-linestring in this method? |
For the current request I haven't heard that this is needed. However for completeness I guess we should. The question is what do you return if so? |
My prototype returns a third column that provides the "part index" of the linestring in a multi-linestring. |
A third clarification: in case there are multiple segments having equal distance to the point, how do you break the tie? |
If we are only returning one, I would suggest to not guarantee any ordering. This gives the most flexibility in a parallel implementation. |
This PR adds C++ API of `point_linestring_nearest_points`. The host counterpart of this function is `shapely.ops.nearest_points`. Multiple fields are written when called on this API, including the geometry and part id indicating the geometry that the nearest point is on. In the header only API, the output iterator accepts a zipped iterator made of 4 output iterators. In the column API, a tuple is returned. The kernel is parallelized per geometry. Each thread computes the nearest point between a pair of multipoint and multilinestring. Contribute to #646 Authors: - Michael Wang (https://github.com/isVoid) Approvers: - H. Thomson Comer (https://github.com/thomcom) - Mark Harris (https://github.com/harrism) URL: #658
This PR adds python API for point-linestring nearest points. Closes #646 . Depend on #658 #686 This PR also moves `Feature_Enum` from io module to geometa module to make sure the coding is consistent and reused throughout the codebase. Authors: - Michael Wang (https://github.com/isVoid) Approvers: - Mark Harris (https://github.com/harrism) - H. Thomson Comer (https://github.com/thomcom) URL: #681
Is your feature request related to a problem? Please describe.
For linestring/point pairs, I would like to calculate not only the distance between points and linestrings, but also the nearest point on the linestring and possibly the index of the segment within the linestring that contains that nearest point.
Describe the solution you'd like
Ingestivate leveraging the functionality in #573 to provide the nearest point and segment index.
The text was updated successfully, but these errors were encountered: