Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pointCollection/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ def to_h5(self, fileOut=None,
for key, val in meta_dict[out_field].items():
if key.lower() not in ['group','source_field','precision','dimensions']:
if isinstance(val, str):
h5f_out[out_field_name.encode('ASCII')].attrs[key] = str(val).encode('utf-8')
# h5f_out[out_field_name.encode('ASCII')].attrs[key] = str(val).encode('utf-8')
h5f_out[out_field_name.encode('ASCII')].attrs.create(str(key), str(val).encode('utf-8'), None, dtype='<S'+str(len(str(val))))
else:
h5f_out[out_field_name.encode('ASCII')].attrs[key] = val
if 'dimensions' in meta_dict[out_field]:
Expand Down Expand Up @@ -914,7 +915,10 @@ def to_h5(self, fileOut=None,

for key, val in self.attrs.items():
if val is not None:
h5f_out[group].attrs[key]=val
if isinstance(val, str):
h5f_out[out_field_name.encode('ASCII')].attrs.create(str(key), str(val).encode('utf-8'), None, dtype='<S'+str(len(str(val))))
else:
h5f_out[group].attrs[key]=val

for key in ['EPSG','SRS_proj4']:
val=getattr(self, key)
Expand Down
Loading