Problem Exporting data to GeoTiFF

I want to export the data in each eopatch to a geotiff file for local use. This is the code I used:

# Exporting to GeoTIFF (failed)
eo=EOPatch.load('./Bizerte_Field_eopatch_folder/eopatch_0/')
path_out='./eopatch_0'
EOPatch_0=ExportToTiff(feature=[(FeatureType.MASK, 'CLM', 'IS_DATA', 'VALID_DATA'),
                                (FeatureType.DATA, 'CLP', 'BANDS', 'NDVI', 'NDWI'),
                                (FeatureType.MASK_TIMELESS, 'VALID_COUNT')],
                       folder=path_out,
                       crs=CRS.UTM_32N)
EOPatch_0=EOPatch_0.execute(eo)

And this is the result I got:
The resultant file eopatch_0.tiff (1.2 MB)

Hi again @rim.sleimi,

You have the correct approach to export an EOPatch to a geotiff. The reason why your code isn’t working is that ExportToTiff only takes a single feature as an input.

If you do want to export all the features of your EOPatch, I would recommend you initialise ExportToTiff several times (making sure to specify a different filename each time).

Thanks for the response !
by a single feature do you mean like this
(FeatureType.MASK, 'CLM', 'IS_DATA', 'VALID_DATA')

or this:
(FeatureType.MASK, 'CLM')

by a single feature do you mean like this
(FeatureType.MASK, 'CLM', 'IS_DATA', 'VALID_DATA')
or this:
(FeatureType.MASK, 'CLM')

The second option, e.g.:

eop = EOPatch.load('./eopatches/eopatch_0/')
EoPatch_0 = ExportToTiff(feature=(FeatureType.MASK, 'CLM'),
                         folder="/path/to/output",
                         crs=CRS.UTM_32N)
EoPatch_0.execute(eop, filename="filename.tif")
1 Like