<div dir="ltr">Hi All, <br><br>We're seeing some major geolocation offsets in PNeo images (order of 1000m, depending on specific image). <br><br>I think I have tracked it down to having something to do with the validity domain. <br>In the cases where I see the offset, I often have metadata that looks like: <br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><ImagetoGround_Validity_Domain><br>  <FIRST_COL>-531</FIRST_COL><br>  <FIRST_ROW>-3182</FIRST_ROW><br>  <LAST_COL>33374</LAST_COL><br>  <LAST_ROW>27699</LAST_ROW><br>                         </ImagetoGround_Validity_Domain><br></blockquote><div><br> <br>From what I can grok from the code, it's an assumption that FIRST_COL and FIRST_ROW be 0 for PNeo, as discussed here: <a href="https://github.com/OSGeo/gdal/issues/5716">https://github.com/OSGeo/gdal/issues/5716</a><br><br>In an earlier version (than 3.7.1), FIRST_COL was manually subtracted from the line offset shift (<a href="https://github.com/OSGeo/gdal/pull/5725/files">https://github.com/OSGeo/gdal/pull/5725/files</a>), but that was reverted later, with the topLeftOffset manually set to 1 for PNeo: <a href="https://github.com/OSGeo/gdal/pull/7653/files">https://github.com/OSGeo/gdal/pull/7653/files</a><br><br>Can it be that this shift is not accounted for? <br><br>Basically, we create tifs by running gdal_translate on the DIM XML file, resulting in a tif with the RPC info inside. <br><br>Doing so on the same image for gdal 3.7.0 and 3.7.1 results in a diff of: <br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">89c88<br><   LINE_OFF=12836<br>---<br>>   LINE_OFF=12305<br>95c94<br><   SAMP_OFF=16819.5<br>---<br>>   SAMP_OFF=16288.5<br>104,105d102<br></blockquote><div><br>in the header. <br><br>The LINE_OFF gets shifted by 531 pixels, which is to be expected, but the SAMP_OFF also gets shifted by 531 pixels, which should not happen, right?  <br><br>Validating  in QGIS, the distance between Google Satellite and the one tower is 777m, at 30cm = 2590 pixels.<br>2590 + 531 = 3121, so within a misclick of 3182<br><br><br>Doing something a bit atrocious I subtracted FIRST_ROW from the LINE_OFF (<a href="https://github.com/fnands/rpcm/blob/1d4205d967985cfcc2426c3fd881352ce5b5ac46/rpcm/rpc_file_readers.py#L235">https://github.com/fnands/rpcm/blob/1d4205d967985cfcc2426c3fd881352ce5b5ac46/rpcm/rpc_file_readers.py#L235</a>), as well as adding FIRST COL to both, and then overwriting the RPC info. <br> This gets me pretty close, as least by visual inspection. <br><br>The diff between the manual one and the raster created with 3.7.1 is: <br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">88c89<br><   LINE_OFF=12305<br>---<br>>   LINE_OFF=14955<br>94c95<br><   SAMP_OFF=16288.5<br>---<br>>   SAMP_OFF=15756.5<br>102c103<br></blockquote><br><br>I feel like I am missing something here, and I am just throwing things at the wall and seeing what sticks. <br>If someone can help me get a more fundamental understanding of what is going wrong here I would greatly appreciate it. <br>Is this offset taken into account somewhere else? <br><br>Importantly, this is <span style="color:rgb(31,35,40);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">DIMAP v3, so not sure if that breaks anything. Waiting on our provider to send me some docs, as the latest ones I have for the RPC reference v2. <br></span><br><br>Cheers,</div><div><br></div><div>Ferdi<br><br><br><br><br></div></div></div>