Skip to content

Commit

Permalink
make docstring and var name more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Dec 28, 2023
1 parent fc2dbc2 commit e51d116
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osmnx/utils_geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ def _intersect_index_quadrats(geometries, polygon):

def bbox_from_point(point, dist=1000, project_utm=False, return_crs=False):
"""
Create a bounding box from a (lat, lon) center point.
Create a bounding box around a (lat, lon) point.
Create a bounding box some distance in each direction (north, south, east,
and west) from the center point and optionally project it.
Create a bounding box some distance (in meters) in each direction (north,
south, east, and west) from the center point and optionally project it.
Parameters
----------
Expand All @@ -408,11 +408,11 @@ def bbox_from_point(point, dist=1000, project_utm=False, return_crs=False):
tuple
(north, south, east, west) or (north, south, east, west, crs_proj)
"""
EARTH_RADIUS = 6_371_009 # meters
EARTH_RADIUS_M = 6_371_009 # meters
lat, lon = point

delta_lat = (dist / EARTH_RADIUS) * (180 / np.pi)
delta_lon = (dist / EARTH_RADIUS) * (180 / np.pi) / np.cos(lat * np.pi / 180)
delta_lat = (dist / EARTH_RADIUS_M) * (180 / np.pi)
delta_lon = (dist / EARTH_RADIUS_M) * (180 / np.pi) / np.cos(lat * np.pi / 180)
north = lat + delta_lat
south = lat - delta_lat
east = lon + delta_lon
Expand Down

0 comments on commit e51d116

Please sign in to comment.