Javier,

TIFFTAG_DATETIME or AREA_OR_POINT are copied by the COG/GTiff drivers from the source dataset metadata.

So using gdal_translate / GDALTranslate(), you may set them with the "-mo KEY=VALUE" option.

If using an intermediate VRT as the source for GDALCreateCopy(), then you may call SetMetadataItem("KEY", "VALUE") on the VRT. I don't see an option in GDALBuildVRT() to do that, but you can definitely open the VRT after it has been created and call SetMetadataItem() on it

Even

Le 04/12/2023 à 16:14, Javier Jimenez Shaw via gdal-dev a écrit :
Hi

I am trying to convert a "normal" tiff file into a COG. For that I am using an intermediate vrt file to add the geolocation parameters, and finally copy the vrt into a COG. I am doing it in C++, but it should be similar doing it on the command line I hope. (In some cases I am using also other parameters of the gdalbuildvrt).

My problem is how are the "magic words" to set the TIFFTAG_* (like TIFFTAG_DATETIME) in the final COG. I guess I could use the option "-oo" for the options in GDALBuildVRT, or in the options of the method "CreateCopy" for COG driver. Is that doable that way? Should I prefix "TIFFTAG_..." with something like "GDALMETADATA:"? (I tried, unsuccessfully)
Is that the same for AREA_OR_POINT?

Thanks.
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to