Skip to content
Snippets Groups Projects
Commit 954aefc9 authored by Pedro L. Magalhães's avatar Pedro L. Magalhães
Browse files

Pre-merge.

parent a28aeaae
No related branches found
No related tags found
1 merge request!3Moves a renamed latest branch into master
......@@ -1030,7 +1030,6 @@ def is_path_straight(network: nx.MultiDiGraph,
# confirm that it is a path
if not is_node_path(network, path, consider_reversed_edges):
return False
# a straight path requires at least two nodes
path_length = len(path)
if path_length == 2:
......@@ -1161,7 +1160,6 @@ def find_simplifiable_paths(network: nx.MultiDiGraph,
if consider_reversed_edges and include_both_directions:
# directions do not matter:
list_paths.append(new_sequence[::-1])
# update the list of intermediate nodes already on paths
list_nodes_joined.update(set(new_sequence[1:-1]))
......@@ -1308,7 +1306,7 @@ def _find_path_direction_sensitive(
)
# cycles have to be detected on the first try
if len(path) >= 3 and path[0] == path[-1]:
# it is a cycle: no need to seedgeh backwards
# it is a cycle: no need to search backwards
return path
# find the backward path segment
return find_path_backward(
......
......@@ -378,7 +378,6 @@ def replace_path(
edge_length = 0
for node_pair_index in range(len(path)-1):
# get one edge for this node pair
edge_key = list(gis_iden.get_edges_between_two_nodes(
network,
......@@ -389,7 +388,6 @@ def replace_path(
(network.edges[_key][osm.KEY_OSMNX_LENGTH], _key)
for _key in edge_key
)[0][1]
if osm.KEY_OSMNX_GEOMETRY in network.edges[edge_key]:
# geometry exists: possibly a composite geometry
# check if the geometry is consistent with the edge declaration
......
......@@ -1024,7 +1024,6 @@ def identify_building_entrance_edges(
# otherwise, the edge is nameless but may not lead to the right street
# get adjacent/neighbouring edges
other_edges = gis_iden.get_edges_involving_node(
network=network,
node_key=closest_edge_key[0],
......@@ -1214,9 +1213,7 @@ def convert_edge_path(network: MultiDiGraph,
# path is a sequence of edge keys: convert to node path
if allow_reversed_edges:
# reverse edges are allowed
# drop self-loops, if any
edge_path = [
edge_key
......
......@@ -4542,6 +4542,10 @@ class TestGisIdentify:
# *************************************************************************
# *************************************************************************
<<<<<<< HEAD
#******************************************************************************
#******************************************************************************
=======
def test_finding_roundabouts(self):
# network should be a OSM-nx formatted graph
......
......@@ -944,7 +944,6 @@ class TestGisUtils:
country_code=country_code)
# find out which is the closest edge
nearest_edge_keys, network = gis_iden.identify_edge_closest_to_node(
network,
node_keys=['P'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment