lines = []
for u, v in edge_nodes:
// if there are parallel edges, select the shortest in length
data = min([data for data in G.edges[u, v].values()], key=lambda x: x["length"])
// if it has a geometry attribute (ie, a list of line segments)
if "geometry" in data and use_geom:
After Change
lines = []
for u, v in edge_nodes:
// if there are parallel edges, select the shortest in length
data = min(G.get_edge_data(u, v).values(), key=lambda x: x["length"])
// if it has a geometry attribute (ie, a list of line segments)
if "geometry" in data and use_geom: