pyrosm icon indicating copy to clipboard operation
pyrosm copied to clipboard

to_graph() method too time consuming

Open SpoJa92 opened this issue 3 years ago • 0 comments

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")

SpoJa92 avatar Feb 03 '22 11:02 SpoJa92