Skip to content

Question: Decomposing path to cell paths? #925

Closed

Description

@akabbeke

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?

Apologies if this is the wrong place to ask this.

Activity

  1. akabbeke commented on Oct 10, 2024

    @akabbeke
    Author

    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.

  2. dfellis commented on Oct 10, 2024

    @dfellis
    Collaborator

    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.

  3. locked and limited conversation to collaborators on Oct 10, 2024
  4. converted this issue into a discussion #928 on Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions