<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">So I changed my C++ code to follow the basic path of gdalcopyproj.py instead of copying the complete data set (see code below), and I am getting a separate .aux.xml file generated instead of the data being merged to the JP2 image file.</div><div class=""><br class=""></div><div class="">Someone mentioned testing against GDAL 2.0, but as I have 1.11.2 which according to the GDAL web page is the latest release.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">char</span> *srcProjection = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">srcDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GetProjectionRef</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">double</span> *srcTransform;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">srcDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GetGeoTransform</span>(srcTransform);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">int</span> gcpcount = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">srcDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GetGCPCount</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">GDAL_GCP</span> *gcps = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">srcDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GetGCPs</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">char</span>* gcpProj = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">srcDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GetGCPProjection</span>();</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">    </span>dstDataset<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = (</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">GDALDataset</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> *) </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GDALOpen</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>maskPath<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GA_Update</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">dstDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetGeoTransform</span>(srcTransform);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">dstDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetProjection</span>(srcProjection);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span> (gcpcount > <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>) {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">dstDataset</span>-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetGCPs</span>( gcpcount, gcps, gcpProj);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class="">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">dstDataset</span> != <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">NULL</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">GDALClose</span>((<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">GDALDatasetH</span>)<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">dstDataset</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">    }</div></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div apple-content-edited="true" class="">
<div class="gmail_signature"><div dir="ltr" class=""><table style="border:none;border-collapse:collapse" class=""><tbody class=""><tr style="height:0px" class=""><td style="border:0px solid rgb(255,255,255);vertical-align:top;padding:7px 15px 7px 7px" class=""><p dir="ltr" style="line-height:1.44;margin-top:0pt;margin-bottom:0pt" class=""><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""><img src="https://lh5.googleusercontent.com/Enixe41p-q_jIylkS6EEcU0RN_K3ng55pO8HWhnj01mlNrWhNVCJePpkXSGW2eT90LlecokRA31oJUaZYGWSWh8uLWHCPhrhXBYmsoYBWnnxG17GnMUNBFr2ngzH0Tv4sfbmKhA" width="137px;" height="61px;" style="border: none;" class=""></span></p></td><td style="border:0px solid rgb(255,255,255);vertical-align:top;padding:7px" class=""><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt" class=""><span style="font-size:16px;font-family:Arial;color:rgb(18,18,18);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class="">Joshua Jackson, PhD</span></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(99,99,99);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class="">Senior ResearchEngineer</span></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(99,99,99);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh5.googleusercontent.com/xatyzuzTr4qR18HGKcLsrwDas9DT5nxjDwkCZq2oG-ccb408r9aQRo2ECtEatULqLfmK6qV7gtExHhXK9xQE3klp1sk76B2zFUAjZ0jBU9G9fjiwoZTgOYf8xDoQ3jgUClsx0FI" width="11px;" height="12px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(221,75,57);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="tel:8006041822,5109" value="+18006041822" target="_blank" style="color:rgb(17,85,204)" class="">(800) 604-1822 Ext. 5109</a></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">  </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/a-PpuK6encseQRC-pViSZ7gztSeVhI2Vas6kFHU--3hOYU3GFekR3Q8P0suxUuqF8xbVUMfIAMyJAZjWSg26CdxKqINZh37L39a4Fw92CF-pLE48m9LaMXB9P9sJBoXV035JqHo" width="7px;" height="11px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="tel:2566485109" value="+12566485112" target="_blank" style="color:rgb(17,85,204)" class="">(256) 648-5109</a></span></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/co3KKKyy46HQYKTzA_uUBeKeze0MmtHwJhER8osdQidG7sjYNblRL5mF9kL4Isk83MheZ7fBtlWxOH2TtR9aIOcl-WPuJJfKd2d-rlRD8V8lZ5T-vfgedI9YPZdvP7_Lke3lWHo" width="13px;" height="11px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="mailto:josh@nside.io" target="_blank" style="color:rgb(17,85,204)" class="">josh@nside.io</a></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">  </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/olJmVY9fnwwcyZclvYYYwl2MV3wVZGfiEaK7tFEUkxggNY4Ktf0yUFeYxxQb-Rt-uZQEk-m1lBfxTZxT9rAoVXBbw9lvT648FaYaYjBkhfO1DexnEkxHRhwUV-LNdlHFrYE4PLA" width="12px;" height="12px;" style="border: none;" class=""></span><ahref="http: www.nside.io="" "="" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap" class=""><a href="http://www.nSide.io" class="">www.nSide.io</a></span></ahref="http:></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><a href="http://www.nside.io/" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/DNCEL6o2IwyEWPCsCo9StUHB31XJHyco59D6mZofeUmOb_zApYHku-xHThh_J1Jlegthj6O4DRIqA0bYbRbHWugyCE8Z7_pHSru836yAReDwIa4sOoUj7oehv9pYIZNY917CGcI" width="12px;" height="11px;" style="border: none;" class=""></span></a><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">4031 Parkway Dr, Suite B, Florence, AL 35630</span></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh6.googleusercontent.com/90X-pf1ZZqJy22YIBBZhA6-N_jli0F4nD14t83iccGDMEAmKLFtAGdgkek1yfExyp5ZcyCSbNSth6NgAPb5ErxJozQBCrXlMN1fbWHgk1YmQfkJ4u07kOQaZT9coaTV9p_-vgk4" width="20px;" height="20px;" style="border: none;" class=""></span><a href="http://www.linkedin.com/company/nside/" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh6.googleusercontent.com/dg5i18x7n8XMqXoiYQxFzmMF_yk04u1ARSEkJmynHAstoGE4kH5SodMxdpnL5fzcNQbfJkXNhcbNffrXczZLOkv0pVOX64Nh2-PWQA_n_UMhgwrqOd9brGu6eM2Hdcz0cZgsHVI" width="20px;" height="20px;" style="border: none;" class=""></span></a><a href="http://twitter.com/nSide__Out" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-size:15px;font-family:Arial;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh6.googleusercontent.com/wz-pnG7cTwQlY4FfRpdMylIPaTGn6ZPuPPDWUWeo4suXNL4MEZJcwPO71EyO7b-eburX_YHvonMjuoHTEU2EyBprm0epnG6xq3UGy24hmWGWF1Z1wr0OHlACGKM-_dH0P4ZJIGo" width="20px;" height="20px;" style="border: none;" class=""></span></a></p></td></tr></tbody></table></div></div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 15, 2015, at 4:06 PM, Dr. Joshua Jackson <<a href="mailto:josh@nside.io" class="">josh@nside.io</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes.  For example original file is middle.jp2  New file is middle_mask.jp2.<div class=""><br class=""></div><div class="">gdalcopyproj.py middle.jp2 middle_mask.jp2</div><div class=""><br class=""></div><div class="">Result is middle_mask.jp2 isn’t even modified according to OS time stamp, but new file is created middle_mask.jp2.aux.xml.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div apple-content-edited="true" class="">
<div class="gmail_signature"><div dir="ltr" class=""><table style="border:none;border-collapse:collapse" class=""><tbody class=""><tr style="height:0px" class=""><td style="border:0px solid rgb(255,255,255);vertical-align:top;padding:7px 15px 7px 7px" class=""><div style="line-height: 1.44; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;" class=""><img src="https://lh5.googleusercontent.com/Enixe41p-q_jIylkS6EEcU0RN_K3ng55pO8HWhnj01mlNrWhNVCJePpkXSGW2eT90LlecokRA31oJUaZYGWSWh8uLWHCPhrhXBYmsoYBWnnxG17GnMUNBFr2ngzH0Tv4sfbmKhA" width="137px;" height="61px;" style="border: none;" class=""></span></div></td><td style="border:0px solid rgb(255,255,255);vertical-align:top;padding:7px" class=""><div style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:16px;font-family:Arial;color:rgb(18,18,18);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class="">Joshua Jackson, PhD</span></div><div style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-family:Arial;color:rgb(99,99,99);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class="">Senior ResearchEngineer</span></div><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(99,99,99);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh5.googleusercontent.com/xatyzuzTr4qR18HGKcLsrwDas9DT5nxjDwkCZq2oG-ccb408r9aQRo2ECtEatULqLfmK6qV7gtExHhXK9xQE3klp1sk76B2zFUAjZ0jBU9G9fjiwoZTgOYf8xDoQ3jgUClsx0FI" width="11px;" height="12px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(221,75,57);font-weight:bold;vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="tel:8006041822,5109" value="+18006041822" target="_blank" style="color:rgb(17,85,204)" class="">(800) 604-1822 Ext. 5109</a></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">  </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/a-PpuK6encseQRC-pViSZ7gztSeVhI2Vas6kFHU--3hOYU3GFekR3Q8P0suxUuqF8xbVUMfIAMyJAZjWSg26CdxKqINZh37L39a4Fw92CF-pLE48m9LaMXB9P9sJBoXV035JqHo" width="7px;" height="11px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="tel:2566485109" value="+12566485112" target="_blank" style="color:rgb(17,85,204)" class="">(256) 648-5109</a></span></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/co3KKKyy46HQYKTzA_uUBeKeze0MmtHwJhER8osdQidG7sjYNblRL5mF9kL4Isk83MheZ7fBtlWxOH2TtR9aIOcl-WPuJJfKd2d-rlRD8V8lZ5T-vfgedI9YPZdvP7_Lke3lWHo" width="13px;" height="11px;" style="border: none;" class=""></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap" class=""><a href="mailto:josh@nside.io" target="_blank" style="color:rgb(17,85,204)" class="">josh@nside.io</a></span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">  </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/olJmVY9fnwwcyZclvYYYwl2MV3wVZGfiEaK7tFEUkxggNY4Ktf0yUFeYxxQb-Rt-uZQEk-m1lBfxTZxT9rAoVXBbw9lvT648FaYaYjBkhfO1DexnEkxHRhwUV-LNdlHFrYE4PLA" width="12px;" height="12px;" style="border: none;" class=""></span><ahref="http: www.nside.io="" "="" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap" class=""><a href="http://www.nside.io/" class="">www.nSide.io</a></span></ahref="http:></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><a href="http://www.nside.io/" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh3.googleusercontent.com/DNCEL6o2IwyEWPCsCo9StUHB31XJHyco59D6mZofeUmOb_zApYHku-xHThh_J1Jlegthj6O4DRIqA0bYbRbHWugyCE8Z7_pHSru836yAReDwIa4sOoUj7oehv9pYIZNY917CGcI" width="12px;" height="11px;" style="border: none;" class=""></span></a><span style="font-family:Arial;color:rgb(221,75,57);vertical-align:baseline;white-space:pre-wrap" class=""> </span><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class="">4031 Parkway Dr, Suite B, Florence, AL 35630</span></p><p dir="ltr" style="line-height:1.2;margin-top:2pt;margin-bottom:0pt" class=""><span style="font-family:Arial;color:rgb(130,130,130);vertical-align:baseline;white-space:pre-wrap" class=""><img src="https://lh6.googleusercontent.com/90X-pf1ZZqJy22YIBBZhA6-N_jli0F4nD14t83iccGDMEAmKLFtAGdgkek1yfExyp5ZcyCSbNSth6NgAPb5ErxJozQBCrXlMN1fbWHgk1YmQfkJ4u07kOQaZT9coaTV9p_-vgk4" width="20px;" height="20px;" style="border: none;" class=""></span><a href="http://www.linkedin.com/company/nside/" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;" class=""> </span><span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;" class=""><img src="https://lh6.googleusercontent.com/dg5i18x7n8XMqXoiYQxFzmMF_yk04u1ARSEkJmynHAstoGE4kH5SodMxdpnL5fzcNQbfJkXNhcbNffrXczZLOkv0pVOX64Nh2-PWQA_n_UMhgwrqOd9brGu6eM2Hdcz0cZgsHVI" width="20px;" height="20px;" style="border: none;" class=""></span></a><a href="http://twitter.com/nSide__Out" target="_blank" style="color:rgb(17,85,204);text-decoration:none" class=""><span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;" class=""> </span><span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;" class=""><img src="https://lh6.googleusercontent.com/wz-pnG7cTwQlY4FfRpdMylIPaTGn6ZPuPPDWUWeo4suXNL4MEZJcwPO71EyO7b-eburX_YHvonMjuoHTEU2EyBprm0epnG6xq3UGy24hmWGWF1Z1wr0OHlACGKM-_dH0P4ZJIGo" width="20px;" height="20px;" style="border: none;" class=""></span></a></p></td></tr></tbody></table></div></div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 15, 2015, at 4:02 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com" class="">even.rouault@spatialys.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Le mercredi 15 avril 2015 22:58:07, Dr. Joshua Jackson a écrit :<br class=""><blockquote type="cite" class="">gdalcopyproj does not work for me because it outputs a separate xml file<br class="">instead of overlaying the data into the new image file.<br class=""></blockquote><br class="">Weird. I've just tested it works properly with the latest GDAL trunk (2.0dev).<br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">Joshua Jackson, PhD<br class="">Senior ResearchEngineer<br class=""> (800) 604-1822 Ext. 5109 <tel:8006041822,5109>   (256) 648-5109<br class=""><tel:2566485109> <a href="mailto:josh@nside.io" class="">josh@nside.io</a> <<a href="mailto:josh@nside.io" class="">mailto:josh@nside.io</a>>   <a href="http://www.nside.io/" class="">www.nSide.io</a><br class=""> <<a href="http://www.nside.io/" class="">http://www.nside.io/</a>> 4031 Parkway Dr, Suite B, Florence, AL 35630<br class="">  <<a href="http://www.linkedin.com/company/nside/" class="">http://www.linkedin.com/company/nside/</a>>  <<a href="http://twitter.com/nSide__Out" class="">http://twitter.com/nSide__Out</a>><br class=""><br class=""><blockquote type="cite" class="">On Apr 15, 2015, at 3:06 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com" class="">even.rouault@spatialys.com</a>><br class="">wrote:<br class=""><br class="">Le mercredi 15 avril 2015 21:46:26, Dr. Joshua Jackson a écrit :<br class=""><blockquote type="cite" class="">I’m looking for a good solution to copy the image meta data from one JP2<br class="">to another JP2 in C++.  I have a folder full of 4096x4096 JPEG2000<br class="">images that I am processing with OpenCV.  On some of them I create a<br class="">copy of the image and do some manipulations to.  As expected the new<br class="">image file is missing all the metadata.<br class=""><br class="">I have tried using CreateCopy() with the OpenJPEG library; and while<br class="">this does work it takes a really long time per image ~40sec.  (My image<br class="">manipulations take only ~10sec).<br class=""><br class="">Is there some way to use the GetGDALDataSet() on the source file and<br class="">then call SetMetaData() on the destination file for each meta data<br class="">item?  How would one iterate through the metadata items?<br class=""></blockquote><br class="">The "metadata" you're talking about are more the georeferencing info,<br class="">right ? (In GDAL "metadata" is about all other metadata, excluding the<br class="">georeferencing)<br class=""><br class="">If you use trunk, you could likely try the new USE_SRC_CODESTREAM=YES<br class="">creation open of the jp2openjpeg driver<br class=""><br class="">Something like:<br class=""><br class="">gdal_translate your_jp2_without_georef.jp2 out.jp2 -co <br class="">USE_SRC_CODESTREAM=YES -a_srs EPSG:4326 -a_ullr  -96.9653320  32.4645996<br class=""> -96.9598389 32.4591064<br class=""><br class="">The SetGeoTransform() and SetProjection() API also do something similar<br class="">internally, so you could also do :<br class=""><br class="">gdal_edit.py your_jp2_without_georef.jp2 -a_srs EPSG:4326 -a_ullr <br class="">-96.9653320 32.4645996  -96.9598389 32.4591064<br class=""><br class="">or more conveniently:<br class=""><br class="">gdalcopyproj.py middle_mask.jp2 out.jp2<br class=""><br class="">(<a href="http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdalcopyproj.py" class="">http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdalcopyproj.py</a><br class=""><<a href="http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdalcopyproj.p" class="">http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdalcopyproj.p</a><br class="">y>)<br class=""><br class="">Even<br class=""><br class=""><blockquote type="cite" class="">Here is a sample GDALInfo printout for a source image:<br class=""><br class="">Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library<br class="">Files: middle_mask.jp2<br class="">Size is 4096, 4096<br class="">Coordinate System is:<br class="">GEOGCS["WGS 84",<br class=""><br class="">   DATUM["WGS_1984",<br class=""><br class="">       SPHEROID["WGS 84",6378137,298.257223563,<br class=""><br class="">           AUTHORITY["EPSG","7030"]],<br class=""><br class="">       AUTHORITY["EPSG","6326"]],<br class=""><br class="">   PRIMEM["Greenwich",0],<br class="">   UNIT["degree",0.0174532925199433],<br class="">   AUTHORITY["EPSG","4326"]]<br class=""><br class="">Origin = (-96.965332031250000,32.464599609375000)<br class="">Pixel Size = (0.000001341104507,-0.000001341104507)<br class=""><br class="">Image Structure Metadata:<br class=""> INTERLEAVE=PIXEL<br class=""><br class="">Corner Coordinates:<br class="">Upper Left  ( -96.9653320,  32.4645996) ( 96d57'55.20"W, 32d27'52.56"N)<br class="">Lower Left  ( -96.9653320,  32.4591064) ( 96d57'55.20"W, 32d27'32.78"N)<br class="">Upper Right ( -96.9598389,  32.4645996) ( 96d57'35.42"W, 32d27'52.56"N)<br class="">Lower Right ( -96.9598389,  32.4591064) ( 96d57'35.42"W, 32d27'32.78"N)<br class="">Center      ( -96.9625854,  32.4618530) ( 96d57'45.31"W, 32d27'42.67"N)<br class="">Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red<br class=""><br class=""> Overviews: 2048x2048, 1024x1024, 512x512, 256x256<br class=""> Overviews: arbitrary<br class=""><br class="">Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green<br class=""><br class=""> Overviews: 2048x2048, 1024x1024, 512x512, 256x256<br class=""> Overviews: arbitrary<br class=""><br class="">Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue<br class=""><br class=""> Overviews: 2048x2048, 1024x1024, 512x512, 256x256<br class=""> Overviews: arbitrary<br class=""><br class="">Joshua Jackson, PhD<br class="">Senior ResearchEngineer<br class="">(800) 604-1822 Ext. 5109 <tel:8006041822,5109>   (256) 648-5109<br class=""><tel:2566485109> <a href="mailto:josh@nside.io" class="">josh@nside.io</a> <<a href="mailto:josh@nside.io" class="">mailto:josh@nside.io</a>><br class=""><<a href="mailto:josh@nside.io" class="">mailto:josh@nside.io</a> <<a href="mailto:josh@nside.io" class="">mailto:josh@nside.io</a>>>   <a href="http://www.nside.io/" class="">www.nSide.io</a><br class=""><<a href="http://www.nside.io/" class="">http://www.nside.io/</a>> <<a href="http://www.nside.io/" class="">http://www.nside.io/</a> <<a href="http://www.nside.io/" class="">http://www.nside.io/</a>>><br class="">4031 Parkway Dr, Suite B, Florence, AL 35630<br class=""><br class=""> <<a href="http://www.linkedin.com/company/nside/" class="">http://www.linkedin.com/company/nside/</a><br class=""> <<a href="http://www.linkedin.com/company/nside/" class="">http://www.linkedin.com/company/nside/</a>>> <br class=""> <<a href="http://twitter.com/nSide__Out" class="">http://twitter.com/nSide__Out</a> <<a href="http://twitter.com/nSide__Out" class="">http://twitter.com/nSide__Out</a>>><br class=""></blockquote></blockquote></blockquote><br class="">-- <br class="">Spatialys - Geospatial professional services<br class=""><a href="http://www.spatialys.com/" class="">http://www.spatialys.com</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>