Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add edge code and snap points to the closest node in network (#166)
Optionally, instead of ending in somewhere in the segment, the network travel ends at the start or end node of a segment (whichever is the closest). To support the snapping based on distance, each segment now has explicit total cost (distance), so Segment and SegmentView need to be classes, not just a using. The generic classes are called edge geometry and edge geometry view. Having the total cost (distance) for segment available allows the travel function to not iterate over a segment when its cost is lower than the remaining distance (cost) to travel (spend). This contains only the changes in the network itself and it add an item to the config. The kernel does not know about snapping (it doesn't need to). * Segment cost as a property to set and as a total or per cell * References for readability instead of pair members in node matrix creation * Read CSV header to determine cost column presence * Add test for edge-variable cost (failing for now) * Advance to next node even when loop continues sooner (fix) * Use only half of start and end cell when counting cost for a segment * Use index to move within segment (changes results) * Methods to get last, first, nth element * Compute cell from distance in segment * Ensure that segment has at least two cells * Add snap to config * Test segment (geometry) and view directly, make them separate classes
- Loading branch information