Skip to content

Commit

Permalink
Merge pull request #1105 from gboeing/dep
Browse files Browse the repository at this point in the history
deprecate return_coords argument in graph_from_address function
  • Loading branch information
gboeing authored Jan 7, 2024
2 parents 2c5835c + 249dda3 commit bd35c3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- fix a bug in the features module's polygon handling (#1104)
- deprecate return_coords argument in graph.graph_from_address function (#1105)

## 1.8.1 (2023-12-31)

Expand Down
13 changes: 11 additions & 2 deletions osmnx/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def graph_from_address(
simplify=True,
retain_all=False,
truncate_by_edge=False,
return_coords=False,
return_coords=None,
clean_periphery=None,
custom_filter=None,
):
Expand Down Expand Up @@ -236,7 +236,7 @@ def graph_from_address(
if True, retain nodes outside bounding box if at least one of node's
neighbors is within the bounding box
return_coords : bool
optionally also return the geocoded coordinates of the address
deprecated, do not use
clean_periphery : bool
deprecated, do not use
custom_filter : string
Expand All @@ -255,6 +255,15 @@ def graph_from_address(
function to automatically make multiple requests: see that function's
documentation for caveats.
"""
if return_coords is None:
return_coords = False
else:
warn(
"The `return_coords` argument has been deprecated and will be removed in "
"a future release. Future behavior will be as though `return_coords=False`. "
"If you want the address's geocoded coordinates, use the `geocode` module.",
stacklevel=2,
)
# geocode the address string to a (lat, lon) point
point = geocoder.geocode(query=address)

Expand Down

0 comments on commit bd35c3c

Please sign in to comment.