Search code examples
graphnodesopenstreetmaposmnx

OSMNX: Street Network projection misses some of the initial nodes


When I project the walking street network of Amsterdam I miss some of the nodes of the initial graph.

import networkx as nx
import osmnx as ox

G_wgs84 = ox.graph_from_place('Amsterdam',retain_all=True, network_type='walk')
G = ox.project_graph(G_wgs84, to_crs='epsg:28992')

Nodes of G_wgs84 = 45960

Nodes of G = 45936

An identified example of a node existing in G_wgs84 but not in G is 7394240355.

Is there any logical explanation of why some nodes exist in the initial graph but not in the projected one?


Solution

  • I get the exact same number of nodes when I run your code snippet:

    import osmnx as ox
    ox.config(log_console=True)
    print(ox.__version__)  # prints v1.1.1
    G1 = ox.graph_from_place('Amsterdam', retain_all=True, network_type='walk')
    G2 = ox.project_graph(G1, to_crs='epsg:28992')
    print(len(G1.nodes), len(G2.nodes))  # prints 46079 46079