[gdal-dev] pipeline algorithm from C API

Even Rouault even.rouault at spatialys.com
Tue Aug 19 01:34:01 PDT 2025


Chris,

> I don't see a way in the C API to obtain the pipeline algorithm step
> registry or access the step algorithms to obtain their argument
> properties and values. Would GetStepAlg()  and related methods
> potentially be exposed in the C API at some point, along with a
> "GetStepRegistry"?
That could be an option. Another already existing one is to use 
GDALAlgorithmGetUsageAsJSON() on the pipeline algorithm. You'll get the 
step algorithms and their arguments under the "pipeline_algorithms" key. 
Please file a ticket if you prefer the C API.
>
> When run as described above, the main pipeline (actual) algorithm
> object has an output arg of type DATASET, but it is not explicitly set
> and has null value even though the file output is successfully
> generated. I assume the dataset object is available in the output arg
> of the "write" step algorithm, but I haven't followed that code
> closely enough to understand some details. If that is correct though,
> could the final output dataset be propagated up to the main pipeline
> algorithm "output" arg?
I suspect a mis-use of the API, because that definitely works as shown 
by the following Python snippet (which uses the C API)

 >>> from osgeo import gdal
 >>> alg = gdal.Run('raster pipeline', pipeline='read 
autotest/gcore/data/byte.tif ! write /vsimem/out.tif')
 >>> print(alg.Output().GetDescription())
/vsimem/out.tif

Maybe you run GDALAlgorithmFinalize() ? If so then the output dataset 
gets closed and the output dataset arg is nullified.

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250819/21eae53f/attachment.htm>


More information about the gdal-dev mailing list