Skip to content

Use Custom Pandana Network/Weights #52

@d-wasserman

Description

@d-wasserman

This is definitely an enhancement idea:
It seems that currently the assumption is the street network is pulled from OSM, but there is little stopping it from using an arbitrary pandana network already created. What is the possibility of integrating custom travel networks?

Generally, I think this is possible, but the big concern I have here is you can't set the CRS assumptions for urbanaccess because of its use of the vincenty function from geopy (which will be removed in 2.0 as an FYI). So you will have to set the pandana network to WGS 1984, but we could document that.

Curious what your thoughts on this might be @sablanchard.

I implemented this with the following as a quick draft, and I think it works (same principle as loading OSM, but loading WGS 1984 projected edges/nodes).

def add_custom_network(network_edges,network_nodes,ua_network,chosen_weight="weight",net_type="walk"):
    """This function will integrate a custom set of nodes and edges that is projected to WGS 1984 so that it integrates with an
    urban access network."""
    network_edges['weight'] = network_edges[chosen_weight]
    # assign node and edge net type
    network_edges['net_type'] = net_type
    network_nodes['net_type'] = net_type
    ua_network.osm_nodes = network_nodes
    ua_network.osm_edges = network_edges
    print("Updated urban access network with updated edges and nodes")
    return ua_network ```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions