Metadata Editor is not writing ENVI-style lists correctly
In the ENVI domain, lists are wrapped by {} brackets, e.g.:
<MDI key="wavelength">{0.46, 0.465, 0.47, ... }
After changing such lists in the Metadata Editor and save, the brackets are gone. This introduces problems in following algorithms!
<MDI key="wavelength">123.456, 0.465, 0.47, ...
Comments (4)
-
-
This regex allows for relaxed parsing of ENVI list values, no matter they start or end with braces. List values could even include braces (
nam{me
), though I think this is not ENVI style any moreimport re text2parse= '{ 42.23 , na{me }' re.split('\s*,\s*', re.sub('(^\s*{\s*|\s*}\s*$)', '', text2parse)) ['42.23', 'na{me']
))
-
reporter Thanks for the workaround, but you really should write the new list in the original format. Its not good to switch formats in between.
-
- changed status to resolved
resolves
#622: wraps list values into braces in case they are written to the GDAL domain "ENVI" (vulnerable algorithms might expect brace wrapping like in none-XML ENVI header files: https://www.l3harrisgeospatial.com/docs/enviheaderfiles.html)→ <<cset a2603630f485>>
- Log in to comment
Which algorithms are affected?