<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 23, 2022 at 7:37 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Michael,<br>
<br>
> Or is it just a matter of forcing an input path to be absolute?<br>
<br>
for regular use cases (ie VRT name not set to empty), you might not even <br>
been able to do that in master since <br>
<a href="https://github.com/OSGeo/gdal/commit/6d7001656d06af138f8e46ff1651056626db11e8" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/commit/6d7001656d06af138f8e46ff1651056626db11e8</a> <br>
which tries to write relative filename as much as possible, even if all <br>
paths are absolute<br>
<br>
Testing with your use case with empty VRT filename, I see the behavior <br>
has not changed, and that you'll indeed get relativeToVRT="0" only if <br>
using a source dataset with an absolute path. For most use cases where <br>
you use an empty filename, it doesn't matter much because you don't <br>
actually re-open it and use it immediately, and thus the source dataset <br>
is not re-opened. I can imagine though that you could get into trouble <br>
if serializing it from the xml:VRT content and re-opening the resulting VRT.<br>
<br>
> Is it possible to force GDAL to make the SourceFilename absolute by <br>
> setting options?<br>
<br>
The solution would probably be to add an explicit creation option to the <br>
VRT driver, like SOURCE_PATH=ABSOLUTE, that would override the current <br>
heuristics.<br>
<br></blockquote><div><br></div><div><br></div><div>Thanks a lot Even, very helpful as always. I can see why relative is the (hard) default, (for auxiliary files to move around with sources). </div><div><br></div><div>I do think I would benefit from this creation option to make some workflows easier, but I still need a bit longer exploring to get all the parts clear (to me) - I'll PR this at some point. </div><div><br></div><div>Best, Mike</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Even<br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Michael Sumner<br>Software and Database Engineer<br>Australian Antarctic Division<br>Hobart, Australia<br>e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div></div>