From f82cc9114edada2a17cf9367b7054d4956527b7b Mon Sep 17 00:00:00 2001 From: dfguerrerom Date: Wed, 22 May 2024 13:43:46 +0200 Subject: [PATCH] refactor: round total bounds --- sepal_ui/aoi/aoi_model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sepal_ui/aoi/aoi_model.py b/sepal_ui/aoi/aoi_model.py index 60e12503..5a4c51d5 100644 --- a/sepal_ui/aoi/aoi_model.py +++ b/sepal_ui/aoi/aoi_model.py @@ -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)."""