Skip to content

Commit

Permalink
replace read_gpickle, gdf.append
Browse files Browse the repository at this point in the history
  • Loading branch information
CanyonFoot committed Oct 4, 2023
1 parent 329b9f1 commit 14f580c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions analysis/src/process/process_walksheds.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import os
ox.config(log_console=True)
ox.__version__
import pickle
import json


Expand Down Expand Up @@ -43,7 +44,7 @@ def fix_walkshed(graph, polygons):
walksheds['osmid'] = unique_nodes
walkshed_lines_fixed = walkshed_lines.drop(columns=['geometry']).merge(walksheds,on='osmid').set_geometry(col='geometry')
poly_a = polygons[~polygons.id.isin(walkshed_lines_fixed.id)]
poly_fixed = poly_a.append(walkshed_lines_fixed)
poly_fixed = pd.concat([poly_a, walkshed_lines_fixed], ignore_index=True)

return poly_fixed

Expand Down Expand Up @@ -126,7 +127,8 @@ def create_walk_shed(points, graph, speed=4.5, trip_time=15, combine=False):
def process_walksheds(config, city_key):

graph_path = f"{config['base_path']}/cities/{city_key}/osm/walk_graph.gpickle"
graph = nx.read_gpickle(graph_path)
with open(graph_path, 'rb') as f:
graph = pickle.load(f)
out_path = f"{config['base_path']}/cities/{city_key}/osm/walksheds/"

if not os.path.isdir(out_path):
Expand Down

0 comments on commit 14f580c

Please sign in to comment.