# Copy coordinates from A.tif (that has coordinates) to B.tif (that does not)

**URL:** <https://forum.opencv.org/t/copy-coordinates-from-a-tif-that-has-coordinates-to-b-tif-that-does-not/6130>\
**Category:** Uncategorized\
**Created:** [November 10, 2021, 9:56am UTC](https://forum.opencv.org/t/copy-coordinates-from-a-tif-that-has-coordinates-to-b-tif-that-does-not/6130 "2021-11-10T09:56:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://forum.opencv.org/u/mike123)\
**Post date:** [November 10, 2021, 9:56am UTC](https://forum.opencv.org/t/copy-coordinates-from-a-tif-that-has-coordinates-to-b-tif-that-does-not/6130/1 "2021-11-10T09:56:18Z")

</div>

Hello, I have A.tif with 4 bands where I read the bands and I do some calculations and write them on B.tif. The end result is B.tif. The problem is that it does not maintain the georeferencing, so I need to copy them from A.tif. How can I achieve that? In other words how do I copy coordinates from **A.tif** to **B.tif**??

---

<div class="post-metadata">

**Author:** ![kbarni](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/kbarni/32/26_2.png) [@kbarni](https://forum.opencv.org/u/kbarni)\
**Post date:** [November 10, 2021, 1:43pm UTC](https://forum.opencv.org/t/copy-coordinates-from-a-tif-that-has-coordinates-to-b-tif-that-does-not/6130/2 "2021-11-10T13:43:01Z")

</div>

OpenCV doesn’t handle GeoTIFF tags. (AFAIK libtiff doesn’t handle geotiff neither).

You might try to transfer the georeferencing data between two images using [libgeotiff](https://github.com/OSGeo/libgeotiff) or similar library.
