Skip to content

Commit

Permalink
simplify visualization bounding box code
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 committed Jan 3, 2023
1 parent be0527a commit c9d8cfd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions icepyx/core/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,12 @@ def __init__(
self.bbox = query_obj.spatial.extent

else:
mrc_bound = (
query_obj.spatial.extent_as_gdf.geometry.unary_union.minimum_rotated_rectangle.bounds
)
# generate bounding box
lonmin = min(mrc_bound.exterior.coords.xy[0])
lonmax = max(mrc_bound.exterior.coords.xy[0])
latmin = min(mrc_bound.exterior.coords.xy[1])
latmax = max(mrc_bound.exterior.coords.xy[1])
(
lonmin,
latmin,
lonmax,
latmax,
) = query_obj.spatial.extent_as_gdf.geometry.unary_union.bounds

self.bbox = [lonmin, latmin, lonmax, latmax]

Expand Down

0 comments on commit c9d8cfd

Please sign in to comment.