Skip to content

Commit

Permalink
replace write_gpickle
Browse files Browse the repository at this point in the history
  • Loading branch information
CanyonFoot committed Oct 4, 2023
1 parent ec9d369 commit 329b9f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion analysis/src/data/get_osm_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from utils.geo import create_extent
import argparse
import sys
import pickle
import os
import json
ox.config(log_console=True)
Expand Down Expand Up @@ -44,7 +45,8 @@ def get_osm_data(config, city_key):
G = get_walk_graph(extent_path)
graph = ox.project_graph(G, to_crs='epsg:4326')
print("Graph created. Writing it")
nx.write_gpickle(G, out_path+"walk_graph.gpickle")
with open(out_path + "walk_graph.gpickle", 'wb') as f:
pickle.dump(G, f, pickle.HIGHEST_PROTOCOL)

def main():
parser = argparse.ArgumentParser("OSM Graph builder")
Expand Down

0 comments on commit 329b9f1

Please sign in to comment.