Commit c4e43794 authored by Daniel Scheffler's avatar Daniel Scheffler

Fixed GeoArray.save() for other formats than ENVI.

parent 9777d0e0
Pipeline #3077 passed with stages
in 1 minute and 23 seconds
......@@ -933,16 +933,19 @@ class GeoArray(object):
elif self.metadata.all_meta:
# set global domain metadata
if self.metadata.global_meta:
ds_out.SetMetadata(self.metadata.global_meta)
ds_out.SetMetadata(dict((k, repr(v)) for k, v in self.metadata.global_meta.items()))
if 'description' in envi_metadict:
ds_out.SetDescription(envi_metadict['description'])
# set band domain metadata
bandmeta_dict = self.metadata.to_DataFrame().astype(str).to_dict()
for bidx in range(self.bands):
band = ds_out.GetRasterBand(bidx + 1)
meta2write = dict((k, repr(v)) for k, v in self.metadata.band_meta.items() if v is not np.nan)
band.SetMetadata(meta2write)
bandmeta = bandmeta_dict[bidx]
# meta2write = dict((k, repr(v)) for k, v in self.metadata.band_meta.items() if v is not np.nan)
band.SetMetadata(bandmeta)
if 'band_names' in envi_metadict:
band.SetDescription(self.metadata.band_meta['band_names'][bidx].strip())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment