How to use the osmnx.count_streets_per_node function in osmnx

To help you get started, we’ve selected a few osmnx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ppintosilva / anprx / anprx / core.py View on Github external
Get nodes representing dead ends in the street network.

    These are not necessarily nodes with degree of 1, in the undirected representation of the street network,

    Parameters
    ----------
    network : nx.MultiDiGraph
        A street network

    Returns
    -------
    network : nx.MultiDiGraph
        The same network, but without dead end nodes and edges
    """
    if not 'streets_per_node' in network.graph:
        network.graph['streets_per_node'] = ox.count_streets_per_node(network)

    streets_per_node = network.graph['streets_per_node']

    return [node for node, count in streets_per_node.items() if count <= 1]
github ppintosilva / anprx / anprx / navigation.py View on Github external
Get nodes representing dead ends in the street network.

    These are not necessarily nodes with degree of 1, in the undirected representation of the street network,

    Parameters
    ----------
    network : nx.MultiDiGraph
        A street network

    Returns
    -------
    network : nx.MultiDiGraph
        The same network, but without dead end nodes and edges
    """
    if not 'streets_per_node' in network.graph:
        network.graph['streets_per_node'] = ox.count_streets_per_node(network)

    streets_per_node = network.graph['streets_per_node']

    return [node for node, count in streets_per_node.items() if count <= 1]