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
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 lines unintentionally
Add plot for investigation of node-mismatch errors
This helps identify where the error is located, e.g. when a network consists of unconnected components
Update 'boundary' line connection method
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
Implement a new function 'drop_parallel_lines'
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.
Since this is called only after all building connections have been created, I think it is save to remove those duplicate lines. There should be no circumstances where the solver chooses a longer line over a shorter one.
Prevent OSError exception in unary_union()
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 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()