Frank, thanks for your usual quick reply.<br><br>As I have thousands of files, anything manual was not an option (of course one could implement your suggestion with sed), so I went the way reading in both files and stealing one file's GCPs with GetGCPs() and write the whole shebang out again -- this also works of course with metadata, noDataValue etc.
<br><br>Ludwig<br><br><div><span class="gmail_quote">On 25/06/07, <b class="gmail_sendername">Frank Warmerdam</b> <<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ludwig M Brinckmann wrote:<br>> I have a set of files with GCPs and a set of files that are the result<br>> of processing the first, which lack the GCPs. The files are GeoTiffs and<br>> they have the same shape.<br>
><br>> Is there a simple way of getting the GCPs out of the first files and to<br>> attach them to the other?<br>><br>> (Simple means simpler than programmatically reading in the georef'ed<br>> file and the non-georef'ed, extracting the GCPs and rewriting the second
<br>> set, now with GCPs)<br><br>Ludwig,<br><br>There is no really simple way of doing this.<br><br>If I had to do it, I would utilize VRT files. Basically I would:<br><br>1) gdal_translate -of VRT original.tif original.vrt
<br>2) gdal_translate -of VRT result.tif result.vrt<br>3) copy the GCPs section of original.vrt to result.vrt in a text editor.<br>4) gdal_translate result.vrt result_with_gcps.tif<br><br>If you only want to do it a very few times this approach should be ok.
<br>This general approach of using VRT files so that various kinds of metadata<br>can be copied/modified/etc can be applied to many similar problems.<br><br>Best regards,<br>--<br>---------------------------------------+--------------------------------------
<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam
</a><br>and watch the world go round - Rush | President OSGeo, <a href="http://osgeo.org">http://osgeo.org</a><br><br></blockquote></div><br>