Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor utils_geo module #1100

Merged
merged 7 commits into from
Dec 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rename var
gboeing committed Dec 24, 2023
commit ce4427e6fa9d49770c9c5c31696885f03cab167d
16 changes: 8 additions & 8 deletions osmnx/plot.py
Original file line number Diff line number Diff line change
@@ -297,8 +297,8 @@ def plot_graph_route(
if ax is None:
# plot the graph but not the route, and override any user show/close
# args for now: we'll do that later
override = {"show", "save", "close"}
kwargs = {k: v for k, v in pg_kwargs.items() if k not in override}
overrides = {"show", "save", "close"}
kwargs = {k: v for k, v in pg_kwargs.items() if k not in overrides}
fig, ax = plot_graph(G, show=False, save=False, close=False, **kwargs)
else:
fig = ax.figure
@@ -375,8 +375,8 @@ def plot_graph_routes(G, routes, route_colors="r", route_linewidths=4, **pgr_kwa
raise ValueError(msg)

# plot the graph and the first route
override = {"route", "route_color", "route_linewidth", "show", "save", "close"}
kwargs = {k: v for k, v in pgr_kwargs.items() if k not in override}
overrides = {"route", "route_color", "route_linewidth", "show", "save", "close"}
kwargs = {k: v for k, v in pgr_kwargs.items() if k not in overrides}
fig, ax = plot_graph_route(
G,
route=routes[0],
@@ -389,8 +389,8 @@ def plot_graph_routes(G, routes, route_colors="r", route_linewidths=4, **pgr_kwa
)

# plot the subsequent routes on top of existing ax
override.update({"ax"})
kwargs = {k: v for k, v in pgr_kwargs.items() if k not in override}
overrides.update({"ax"})
kwargs = {k: v for k, v in pgr_kwargs.items() if k not in overrides}
r_rc_rlw = zip(routes[1:], route_colors[1:], route_linewidths[1:])
for route, route_color, route_linewidth in r_rc_rlw:
fig, ax = plot_graph_route(
@@ -559,8 +559,8 @@ def plot_figure_ground(
bbox = utils_geo.bbox_from_point(point, dist, project_utm=False)

# plot the figure
override = {"bbox", "node_size", "node_color", "edge_linewidth"}
kwargs = {k: v for k, v in pg_kwargs.items() if k not in override}
overrides = {"bbox", "node_size", "node_color", "edge_linewidth"}
kwargs = {k: v for k, v in pg_kwargs.items() if k not in overrides}
fig, ax = plot_graph(
G=Gu,
bbox=bbox,