Fix various errors in network connections#128
Merged
Conversation
This helps identify where the error is located, e.g. when a network consists of unconnected components
- Replace some for-loops with vectorized functions for better performance. The recursive design is still quite slow, but the change showed a 4x speed improvement in one test case. - Fix an error that could remove line segments unintentionally
If multiple lines connect the same two points in a network, eomof.solph will throw an error. Keep only the shortest of all lines connecting the same two points.
- Catch special cases where the regular street lines already touch the building. This would already fulfill the boundary method, but for dhnx a connection line is required for each building. Use midpoint for these cases. - Remove a misplaced 'convex_hull' call
This issue was already discussed in #107 and fixed for connect_points.py in b25921f. Now the same access violation error came up at this point. It could be confirmed that the issue happens only with shapely < 2.0 and is not occuring with shapely >= 2.0. If that ever becomes a requirement, the 'list()' could be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR attempts to resolve #127 and the various problems described in it.
No function interfaces are changed and I think this could be considered a "hotfix" to v0.0.3.
Improve 'weld_segments' function
Add plot for investigation of node-mismatch errors
Update 'boundary' line connection method
Implement a new function 'drop_parallel_lines'
Prevent OSError exception in unary_union()