ds.SetMetadata('non_key_equal_value_content', 'GEOLOCATION') crashes on GeoTIFF
|Reported by:||Even Rouault||Owned by:||Even Rouault|
The following snippet crashes :
import osgeo.gdal as gdal from osgeo.gdalconst import * d=gdal.Open('ZOO_DATA_raster_11158.data', GA_Update) d.SetMetadata('PIXEL_SKIP=1', 'GEOLOCATION') d=None
This is due to 'PIXEL_SKIP=1' being passed as a string, and not as an array.
There are 2 problems in fact :
1) The SWIG bindings have an alternate definition of SetMetadata() that should allow specifying a metadata string instead of a metadata array, but that doesn't work due to method wrongly interpreting the string as an array of characters, which is not wanted
2) The GeoTIFF driver isn't robust to metadata strings not being under the k=v format