You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does there exist an efficient way to decompose a straight line between two location into the individual line segments which cross each cell at a given resolution?
The solution I was considering was to try a kind of binary search. Find where the line intersects the cell boundary for the first and last cells. If the intersections are at the same location then we know they are neighbours and the line passed through a shared boundary edge. If not then find the midpoint between the two points and repeat the process until an unbroken line exists between the original start and end points.
I’m fairly certain the above approach works, but I’m not sure if it is the most efficient approach or if there exists a better method.
Activity
akabbeke commentedon Oct 10, 2024
The solution I was considering was to try a kind of binary search. Find where the line intersects the cell boundary for the first and last cells. If the intersections are at the same location then we know they are neighbours and the line passed through a shared boundary edge. If not then find the midpoint between the two points and repeat the process until an unbroken line exists between the original start and end points.
I’m fairly certain the above approach works, but I’m not sure if it is the most efficient approach or if there exists a better method.
dfellis commentedon Oct 10, 2024
This should be a discussion, not an issue with the library. I am going to try to convert it, but this is my first time doing so.