[gdal-dev] argument default value in the C API to GDALAlgorithmArg
Even Rouault
even.rouault at spatialys.com
Mon Aug 4 01:42:41 PDT 2025
Hi Chris,
This was indeed missing in the C API. Queued for 3.12 in
https://github.com/OSGeo/gdal/pull/12853
If you need this in 3.11, you can define the following implementation
detail in your code
struct GDALAlgorithmArgHS
{
GDALAlgorithmArg *ptr = nullptr;
explicit GDALAlgorithmArgHS(GDALAlgorithmArg *arg) : ptr(arg)
{
}
};
but better conditionalize it to 3.11 only, so that to avoid issues in
later version if we would change the definition of struct GDALAlgorithmArgHS
and then do things like
GDALAlgorithmArgH hArg;
hArg->ptr->GetDefault<std::string>();
Even
Le 04/08/2025 à 03:46, Chris Toney via gdal-dev a écrit :
> Hi,
> In the C API there is GDALAlgorithmArgHasDefaultValue(), but no
> interface to the GetDefault() class method to access the value itself
> when there is one (nor in the Python bindings, AFAICS).
>
> I don't believe there is a fromHandle() method on GDALAlgorithmArg to
> get to the C++ object.
>
> Is there possibly a workaround for that when working through the C API?
>
> Chris
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
My software is free, but my time generally not.
More information about the gdal-dev
mailing list