<div dir="auto">Hi Even,<div dir="auto">Much appreciated! That workaround solved for 3.11.</div><div dir="auto"><br></div><div dir="auto">Chris</div><div dir="auto"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Aug 4, 2025, 2:42 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chris,<br>
<br>
This was indeed missing in the C API. Queued for 3.12 in <br>
<a href="https://github.com/OSGeo/gdal/pull/12853" rel="noreferrer noreferrer" target="_blank">https://github.com/OSGeo/gdal/pull/12853</a><br>
<br>
If you need this in 3.11, you can define the following implementation <br>
detail in your code<br>
<br>
struct GDALAlgorithmArgHS<br>
{<br>
     GDALAlgorithmArg *ptr = nullptr;<br>
<br>
     explicit GDALAlgorithmArgHS(GDALAlgorithmArg *arg) : ptr(arg)<br>
     {<br>
     }<br>
};<br>
<br>
but better conditionalize it to 3.11 only, so that to avoid issues in <br>
later version if we would change the definition of struct GDALAlgorithmArgHS<br>
<br>
and then do things like<br>
<br>
GDALAlgorithmArgH hArg;<br>
<br>
hArg->ptr->GetDefault<std::string>();<br>
<br>
Even<br>
<br>
<br>
Le 04/08/2025 à 03:46, Chris Toney via gdal-dev a écrit :<br>
> Hi,<br>
> In the C API there is GDALAlgorithmArgHasDefaultValue(), but no<br>
> interface to the GetDefault() class method to access the value itself<br>
> when there is one (nor in the Python bindings, AFAICS).<br>
><br>
> I don't believe there is a fromHandle() method on GDALAlgorithmArg to<br>
> get to the C++ object.<br>
><br>
> Is there possibly a workaround for that when working through the C API?<br>
><br>
> Chris<br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote></div>