@@ -138,7 +138,8 @@ def update_generation_info(self, data: dict[Any, Any]) -> None:
138
138
def get_bbox (
139
139
self ,
140
140
coordinates : tuple [float , float ] | None = None ,
141
- distance : int | None = None ,
141
+ height_distance : int | None = None ,
142
+ width_distance : int | None = None ,
142
143
project_utm : bool = False ,
143
144
) -> tuple [int , int , int , int ]:
144
145
"""Calculates the bounding box of the map from the coordinates and the height and
@@ -148,28 +149,34 @@ def get_bbox(
148
149
Args:
149
150
coordinates (tuple[float, float], optional): The latitude and longitude of the center of
150
151
the map. Defaults to None.
151
- distance (int, optional): The distance from the center of the map to the edge of the
152
- map. Defaults to None.
152
+ height_distance (int, optional): The distance from the center of the map to the edge of
153
+ the map in the north-south direction. Defaults to None.
154
+ width_distance (int, optional): The distance from the center of the map to the edge of
155
+ the map in the east-west direction. Defaults to None.
153
156
project_utm (bool, optional): Whether to project the bounding box to UTM.
154
157
155
158
Returns:
156
159
tuple[int, int, int, int]: The bounding box of the map.
157
160
"""
158
161
coordinates = coordinates or self .coordinates
159
- distance = distance or int (self .map_height / 2 )
162
+ height_distance = height_distance or int (self .map_height / 2 )
163
+ width_distance = width_distance or int (self .map_width / 2 )
160
164
161
165
north , south , _ , _ = ox .utils_geo .bbox_from_point (
162
- coordinates , dist = distance , project_utm = project_utm
166
+ coordinates , dist = height_distance , project_utm = project_utm
163
167
)
164
168
_ , _ , east , west = ox .utils_geo .bbox_from_point (
165
- coordinates , dist = distance , project_utm = project_utm
169
+ coordinates , dist = width_distance , project_utm = project_utm
166
170
)
167
171
bbox = north , south , east , west
168
172
self .logger .debug (
169
- "Calculated bounding box for component: %s: %s, project_utm: %s" ,
173
+ "Calculated bounding box for component: %s: %s, project_utm: %s, "
174
+ "height_distance: %s, width_distance: %s" ,
170
175
self .__class__ .__name__ ,
171
176
bbox ,
172
177
project_utm ,
178
+ height_distance ,
179
+ width_distance ,
173
180
)
174
181
return bbox
175
182
0 commit comments