[gdal-dev] Metadata from GeoTIFF to ENVI

Even Rouault even.rouault at spatialys.com
Fri Jan 1 02:02:38 PST 2016


Le jeudi 31 décembre 2015 23:31:40, nguler at jlab.org a écrit :
> Dear GDAL Users,
> 
> I am reading a GeoTIFF file and creating an ENVI file. I don't want to use
> the CreateCopy method but the Create method.
> 
> I tried something like the following to transfer the metadata:
> 
>    char **papszMetadataSet;
>    papszMetadataSet = poDataset->GetMetadata();
>    poDstDS->SetMetadata(papszMetadataSet);
> 
> But, it did not work. I am pretty new to GDAL and I would greatly
> appreciate an example on how to transfer Metadata while creating an ENVI
> type file. I would like to learn how to transfer the whole metadata and
> also selected part of it.

Nevzat,

According to http://www.gdal.org/frmt_various.html#ENVI , "all ENVI header 
fields will be stored in the ENVI metadata domain, and all of these can then be 
written out to the header file". Which means in your case, you should motify 
your last line to be :

poDstDS->SetMetadata(papszMetadataSet, "ENVI");

Even

> 
> Best regards,
> - Nevzat
> 
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list