Skip to content

Commit

Permalink
refactor: round total bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom committed May 22, 2024
1 parent 89c7b25 commit f82cc91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sepal_ui/aoi/aoi_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,11 @@ def total_bounds(self) -> Tuple[float, float, float, float]:

if self.gee:
coords = self.feature_collection.geometry().bounds().coordinates().get(0).getInfo()
return [coords[0][0], coords[0][1], coords[3][0], coords[3][1]]
bounds = [coords[0][0], coords[0][1], coords[3][0], coords[3][1]]
else:
bounds = self.gdf.total_bounds.tolist()

return self.gdf.total_bounds.tolist()
return [round(bound, 4) for bound in bounds]

def export_to_asset(self) -> Self:
"""Export the feature_collection as an asset (only for ee model)."""
Expand Down

0 comments on commit f82cc91

Please sign in to comment.