pyrosm
pyrosm copied to clipboard
to_graph() method too time consuming
Hi,
I am working with the OSM for Germany. I loaded the pbf.-file succesfully. However, converting the data into a graph is too time consuming.
How can I speed up the process?
I am attaching my code for more details. Thank you for your support.
import os
from pyrosm import OSM, get_data
import osmnx as ox
import networkx as nx
os.chdir(r"my_path")
pbf = "germany-latest.osm.pbf"
osm = OSM(pbf)
print(type(osm))
nodes, edges = osm.get_network(nodes=True, network_type="driving")
G = osm.to_graph(nodes, edges, graph_type="networkx")