Skip to content

Commit

Permalink
Update graph_utilities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed Mar 25, 2024
1 parent d3a534a commit 3088112
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion swmmanywhere/graph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ def __call__(self, G: nx.Graph, **kwargs) -> nx.Graph:
start_point_edge = data['geometry'].coords[0]
end_point_node = (G.nodes[v]['x'], G.nodes[v]['y'])
end_point_edge = data['geometry'].coords[-1]
if (start_point_edge != start_point_node) | \
if (start_point_edge == end_point_node) & \
(end_point_edge == start_point_node):
data['geometry'] = data['geometry'].reverse()
elif (start_point_edge != start_point_node) | \
(end_point_edge != end_point_node):
data['geometry'] = shapely.LineString([start_point_node,
end_point_node])
Expand Down

0 comments on commit 3088112

Please sign in to comment.