Commit b7177478 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Simplified syntax in corner_coord_to_minmax.

parent 797f4d69
Pipeline #30313 passed with stage
in 3 minutes and 41 seconds
......@@ -169,11 +169,10 @@ def corner_coord_to_minmax(corner_coords):
# type: (Iterable[Tuple[float, float], Tuple[float, float], Tuple[float, float], Tuple[float, float]]) -> tuple
"""Return the bounding coordinates for a given set of XY coordinates.
:param corner_coords: # four XY tuples of corner coordinates. Their order does not matter.
:param corner_coords: four XY tuples of corner coordinates. Their order does not matter.
:return: xmin,xmax,ymin,ymax
"""
x_vals = [i[0] for i in corner_coords]
y_vals = [i[1] for i in corner_coords]
x_vals, y_vals = zip(*corner_coords)
xmin, xmax, ymin, ymax = min(x_vals), max(x_vals), min(y_vals), max(y_vals)
return xmin, xmax, ymin, ymax
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment