From d9b541b0eb985f43cdf66c92f1421d79b07c330e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20D=2EKov=C3=A1cs?= <123364246+daviddkovacs@users.noreply.github.com> Date: Sat, 21 Dec 2024 09:36:50 +0100 Subject: [PATCH] Update gee_processing.py --- pyeogpr/gee_processing.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pyeogpr/gee_processing.py b/pyeogpr/gee_processing.py index 97c0e1f6..f39e98ac 100644 --- a/pyeogpr/gee_processing.py +++ b/pyeogpr/gee_processing.py @@ -340,9 +340,16 @@ def maploop(self): lakemask = lakes.eq(0) image_export = image_export.mask(lakemask) image_export = image_export.mask(bare_cover) - - # Convert to uint8 for lower memory usage - # image_export = image_export.multiply(255 / data_range).uint8() + + # SHP-bbox misery + region = None + if type(self.bbox) is list: + region=self.bbox + image_export = image_export.clip(region) + elif isinstance(self.bbox, ee.FeatureCollection): + region = self.bbox.geometry() + image_export = image_export.clip(region) + image_export = image_export.set( "system:time_start", ee.Date(self.temporal_extent[0]) @@ -350,14 +357,6 @@ def maploop(self): .millis(), ) - # SHP-bbox misery - region = None - if type(self.bbox) is list: - region=self.bbox - elif isinstance(self.bbox, ee.FeatureCollection): - region = self.bbox.geometry() - - image_export = image_export.clip(region) # Export the image to an asset exportar = ee.batch.Export.image.toAsset( assetId=self.assetpath