I have applied the following patch for my own needs to gdalwarp.cpp (from release 1.8.1). Maybe could it be applied in the next release with the appropriate changes?<br>Thanks for your answers.<br><br><br>791a792,818<br>> /* Get the metadata of the first source file if it is a GeoTiff */<br>
> /* and apply them to the destination file. */<br>> /* -------------------------------------------------------------------- */<br>> if ( iSrc==0 && pszFormat == "GTiff")<br>
> {<br>> char **metadataSet=NULL;<br>> metadataSet = GDALGetMetadata(hSrcDS, "");<br>> <br>> if( CSLCount(metadataSet) > 0 )<br>> {<br>
> for( i = 0; metadataSet[i] != NULL; i++ )<br>> {<br>> char *val = CPLStrdup(strstr(metadataSet[i],"=")+1);<br>> size_t lenkey = strlen(metadataSet[i])-strlen(val);<br>
> char *key = (char*)malloc(lenkey);<br>> strncpy(key, metadataSet[i], lenkey);<br>> key[lenkey-1] = '\0';<br>> <br>> if( GDALSetMetadataItem(hDstDS, key, val, NULL) != CE_None ){<br>
> fprintf( stderr, "Ecriture du tag %s impossible", key);<br>> }<br>> <br>> }<br>> }<br>> }<br>
> <br>> /* -------------------------------------------------------------------- */<br><br><br><br><br><br><br><div class="gmail_quote">Le 10 novembre 2011 13:40, fred p <span dir="ltr"><<a href="mailto:mapoubelle22@gmail.com">mapoubelle22@gmail.com</a>></span> a écrit :<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello list !<br><br>I use the gdalwarp tool to change the projection of a GeoTiff file but the most of the metadata of the source file are lost, which is not the case with the gdal_translate tool.<br>
Particularly, the following metadata are lost :<br>
TIFFTAG_DOCUMENTNAME<br> TIFFTAG_IMAGEDESCRIPTION<br> TIFFTAG_SOFTWARE<br> TIFFTAG_DATETIME<br> TIFFTAG_ARTIST<br> TIFFTAG_HOSTCOMPUTER<br><br>Do I miss something ?<br><br><br>The command :<br><br>gdalwarp -t_srs EPSG:4326 srcfile.tif outfile.tif<br>
<br><br>The gdalinfo output on the source file, followed by the gdalinfo output on the output file :<br><br>Driver: GTiff/GeoTIFF<br>Files: srcfile.tif<br>Size is 2500, 2500<br>Coordinate System is:<br>PROJCS["Geostationary_Satellite",<br>
GEOGCS["GCS_unnamed ellipse",<br> DATUM["D_unknown",<br> SPHEROID["Unknown",6378160,298.2539162964669]],<br> PRIMEM["Greenwich",0],<br> UNIT["Degree",0.017453292519943295]],<br>
PROJECTION["Geostationary_Satellite"],<br> PARAMETER["central_meridian",57],<br> PARAMETER["satellite_height",35785846.6396],<br> PARAMETER["false_easting",0],<br> PARAMETER["false_northing",0],<br>
UNIT["Meter",1]]<br>Origin = (-5620805.668447489850223,5620805.668447489850223)<br>Pixel Size = (4496.644534757992005,-4496.644534757992005)<br>Metadata:<br> TIFFTAG_DOCUMENTNAME=documentname<br> TIFFTAG_IMAGEDESCRIPTION=productidentification={<br>
"observedProperty":"observedProperty",<br> "process":"process",<br>}<br> TIFFTAG_SOFTWARE=software<br> TIFFTAG_DATETIME=2011:11:10 11:00:00<br> TIFFTAG_ARTIST=artist<br>
TIFFTAG_HOSTCOMPUTER=computer<br> AREA_OR_POINT=Area<br>Image Structure Metadata:<br> COMPRESSION=JPEG<br> INTERLEAVE=BAND<br>Corner Coordinates:<br>ERROR 1: tolerance condition error<br>Upper Left (-5620805.668, 5620805.668) <br>
ERROR 1: tolerance condition error<br>Lower Left (-5620805.668,-5620805.668) <br>ERROR 1: tolerance condition error<br>Upper Right ( 5620805.668, 5620805.668) <br>ERROR 1: tolerance condition error<br>Lower Right ( 5620805.668,-5620805.668) <br>
Center ( 0.0000000, 0.0000000) ( 57d 0'0.00"E, 0d 0'0.01"N)<br>Band 1 Block=2500x1 Type=Byte, ColorInterp=Gray<br><br><br>The gdalinfo output on the output file :<br><br>Driver: GTiff/GeoTIFF<br>
Files: outfile.tif<br>Size is 1673, 1673<br>Coordinate System is:<br>GEOGCS["WGS 84",<br> DATUM["WGS_1984",<br> SPHEROID["WGS 84",6378137,298.257223563,<br> AUTHORITY["EPSG","7030"]],<br>
AUTHORITY["EPSG","6326"]],<br> PRIMEM["Greenwich",0],<br> UNIT["degree",0.0174532925199433],<br> AUTHORITY["EPSG","4326"]]<br>Origin = (0.000000000000000,70.000000000000000)<br>
Pixel Size = (0.059772863120143,-0.059772863120143)<br>Metadata:<br> AREA_OR_POINT=Area<br>Image Structure Metadata:<br> INTERLEAVE=BAND<br>Corner Coordinates:<br>Upper Left ( 0.0000000, 70.0000000) ( 0d 0'0.01"E, 70d 0'0.00"N)<br>
Lower Left ( 0.0000000, -30.0000000) ( 0d 0'0.01"E, 30d 0'0.00"S)<br>Upper Right ( 100.0000000, 70.0000000) (100d 0'0.00"E, 70d 0'0.00"N)<br>Lower Right ( 100.0000000, -30.0000000) (100d 0'0.00"E, 30d 0'0.00"S)<br>
Center ( 50.0000000, 20.0000000) ( 50d 0'0.00"E, 20d 0'0.00"N)<br>Band 1 Block=1673x4 Type=Byte, ColorInterp=Gray<br><br>
        <img src="http://www.qtl.co.il/img/copy.png" title="Copy Selction"><a href="http://int.ask.com/web?siteid=10000861&webqsrc=999&l=dis&q=dust%20RGB%20composite" title="Search With Ask" target="_blank"><img src="http://www.ask.com/favicon.ico"></a><img src="http://translate.google.com/favicon.ico" title="Translate With Google">
        
</blockquote></div><br>