# gdalalgorithm.h: GDALAlgorithm (CLI) C API

## Include file

gdalalgorithm.h

## API

Defines

GADV_NAME

  Bit indicating that the name component of GDALArgDatasetValue is accepted.

GADV_OBJECT

  Bit indicating that the dataset component of GDALArgDatasetValue is accepted.

Typedefs

typedef struct GDALArgDatasetValueHS *GDALArgDatasetValueH

  Opaque C type for GDALArgDatasetValue.

typedef struct GDALAlgorithmArgHS *GDALAlgorithmArgH

  Opaque C type for GDALAlgorithmArg.

typedef struct GDALAlgorithmHS *GDALAlgorithmH

  Opaque C type for GDALAlgorithm.

typedef struct GDALAlgorithmRegistryHS *GDALAlgorithmRegistryH

  Opaque C type for GDALAlgorithmRegistry.

typedef int GDALArgDatasetType

  Binary-or combination of GDAL_OF_RASTER, GDAL_OF_VECTOR, GDAL_OF_MULTIDIM_RASTER, possibly with GDAL_OF_UPDATE.

Enums

enum GDALAlgorithmArgType

  Type of an argument.

  Values:

  enumerator GAAT_BOOLEAN

    Boolean type.

    Value is a bool.

  enumerator GAAT_STRING

    Single-value string type.

    Value is a std::string

  enumerator GAAT_INTEGER

    Single-value integer type.

    Value is a int

  enumerator GAAT_REAL

    Single-value real type.

    Value is a double

  enumerator GAAT_DATASET

    Dataset type.

    Value is a GDALArgDatasetValue

  enumerator GAAT_STRING_LIST

    Multi-value string type.

    Value is a std::vector<std::string>

  enumerator GAAT_INTEGER_LIST

    Multi-value integer type.

    Value is a std::vector<int>

  enumerator GAAT_REAL_LIST

    Multi-value real type.

    Value is a std::vector<double>

  enumerator GAAT_DATASET_LIST

    Multi-value dataset type.

    Value is a std::vector<GDALArgDatasetValue>

Functions

bool GDALAlgorithmArgTypeIsList(GDALAlgorithmArgType type)

  Return whether the argument type is a list / multi-valued one.

const char *GDALAlgorithmArgTypeName(GDALAlgorithmArgType type)

  Return the string representation of the argument type.

GDALAlgorithmRegistryH GDALGetGlobalAlgorithmRegistry(void)

  Gets a handle to the GDALGetGlobalAlgorithmRegistry which references all available top-level GDAL algorithms ("raster", "vector", etc.)

  The handle must be released with GDALAlgorithmRegistryRelease() (but this does not destroy the GDALAlgorithmRegistryRelease singleton).

  Since

    3.11

void GDALAlgorithmRegistryRelease(GDALAlgorithmRegistryH)

  Release a handle to an algorithm registry, but this does not destroy the registry itself.

  Since

    3.11

char **GDALAlgorithmRegistryGetAlgNames(GDALAlgorithmRegistryH)

  Return the names of the algorithms registered in the registry passed as parameter.

  Since

    3.11

  Parameters:

    hReg -- Handle to a registry. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

GDALAlgorithmH GDALAlgorithmRegistryInstantiateAlg(GDALAlgorithmRegistryH, const char *pszAlgName)

  Instantiate an algorithm available in a registry from its name.

  Since

    3.11

  Parameters:

    - hReg -- Handle to a registry. Must NOT be null.

    - pszAlgName -- Algorithm name. Must NOT be null.

  Returns:

    an handle to the algorithm (to be freed with GDALAlgorithmRelease), or NULL if the algorithm does not exist or another error occurred.

GDALAlgorithmH GDALAlgorithmRegistryInstantiateAlgFromPath(GDALAlgorithmRegistryH, const char *const *papszAlgPath)

  Instantiate an algorithm available in a registry from its path.

  Since

    3.12

  Parameters:

    - hReg -- Handle to a registry. Must NOT be null.

    - papszAlgPath -- Algorithm path. Must NOT be null.

  Returns:

    an handle to the algorithm (to be freed with GDALAlgorithmRelease), or NULL if the algorithm does not exist or another error occurred.

void GDALAlgorithmRelease(GDALAlgorithmH)

  Release a handle to an algorithm.

  Since

    3.11

const char *GDALAlgorithmGetName(GDALAlgorithmH)

  Return the algorithm name.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    algorithm name whose lifetime is bound to hAlg and which must not be freed.

const char *GDALAlgorithmGetDescription(GDALAlgorithmH)

  Return the algorithm (short) description.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    algorithm description whose lifetime is bound to hAlg and which must not be freed.

const char *GDALAlgorithmGetLongDescription(GDALAlgorithmH)

  Return the algorithm (longer) description.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    algorithm description whose lifetime is bound to hAlg and which must not be freed.

const char *GDALAlgorithmGetHelpFullURL(GDALAlgorithmH)

  Return the algorithm full URL.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    algorithm URL whose lifetime is bound to hAlg and which must not be freed.

bool GDALAlgorithmHasSubAlgorithms(GDALAlgorithmH)

  Return whether the algorithm has sub-algorithms.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

char **GDALAlgorithmGetSubAlgorithmNames(GDALAlgorithmH)

  Get the names of registered algorithms.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

GDALAlgorithmH GDALAlgorithmInstantiateSubAlgorithm(GDALAlgorithmH, const char *pszSubAlgName)

  Instantiate an algorithm by its name (or its alias).

  Since

    3.11

  Parameters:

    - hAlg -- Handle to an algorithm. Must NOT be null.

    - pszSubAlgName -- Algorithm name. Must NOT be null.

  Returns:

    an handle to the algorithm (to be freed with GDALAlgorithmRelease), or NULL if the algorithm does not exist or another error occurred.

bool GDALAlgorithmParseCommandLineArguments(GDALAlgorithmH, CSLConstList papszArgs)

  Parse a command line argument, which does not include the algorithm name, to set the value of corresponding arguments.

  Since

    3.11

  Parameters:

    - hAlg -- Handle to an algorithm. Must NOT be null.

    - papszArgs -- NULL-terminated list of arguments, not including the algorithm name.

  Returns:

    true if successful, false otherwise

GDALAlgorithmH GDALAlgorithmGetActualAlgorithm(GDALAlgorithmH)

  Return the actual algorithm that is going to be invoked, when the current algorithm has sub-algorithms.

  Only valid after GDALAlgorithmParseCommandLineArguments() has been called.

  Note that the lifetime of the returned algorithm does not exceed the one of the hAlg instance that owns it.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    an handle to the algorithm (to be freed with GDALAlgorithmRelease).

bool GDALAlgorithmRun(GDALAlgorithmH, GDALProgressFunc pfnProgress, void *pProgressData)

  Execute the algorithm, starting with ValidateArguments() and then calling RunImpl().

  Since

    3.11

  Parameters:

    - hAlg -- Handle to an algorithm. Must NOT be null.

    - pfnProgress -- Progress callback. May be null.

    - pProgressData -- Progress callback user data. May be null.

  Returns:

    true if successful, false otherwise

bool GDALAlgorithmFinalize(GDALAlgorithmH)

  Complete any pending actions, and return the final status.

  This is typically useful for algorithm that generate an output dataset.

  Note that this function does NOT release memory associated with the algorithm. GDALAlgorithmRelease() must still be called afterwards.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    true if successful, false otherwise

char *GDALAlgorithmGetUsageAsJSON(GDALAlgorithmH)

  Return the usage of the algorithm as a JSON-serialized string.

  This can be used to dynamically generate interfaces to algorithms.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    a string that must be freed with CPLFree()

char **GDALAlgorithmGetArgNames(GDALAlgorithmH)

  Return the list of available argument names.

  Since

    3.11

  Parameters:

    hAlg -- Handle to an algorithm. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

GDALAlgorithmArgH GDALAlgorithmGetArg(GDALAlgorithmH, const char *pszArgName)

  Return an argument from its name.

  The lifetime of the returned object does not exceed the one of hAlg.

  Since

    3.11

  Parameters:

    - hAlg -- Handle to an algorithm. Must NOT be null.

    - pszArgName -- Argument name. Must NOT be null.

  Returns:

    an argument that must be released with GDALAlgorithmArgRelease(), or nullptr in case of error

GDALAlgorithmArgH GDALAlgorithmGetArgNonConst(GDALAlgorithmH, const char *pszArgName)

  Return an argument from its name, possibly allowing creation of user-provided argument if the algorithm allow it.

  The lifetime of the returned object does not exceed the one of hAlg.

  Since

    3.12

  Parameters:

    - hAlg -- Handle to an algorithm. Must NOT be null.

    - pszArgName -- Argument name. Must NOT be null.

  Returns:

    an argument that must be released with GDALAlgorithmArgRelease(), or nullptr in case of error

void GDALAlgorithmArgRelease(GDALAlgorithmArgH)

  Release a handle to an argument.

  Since

    3.11

const char *GDALAlgorithmArgGetName(GDALAlgorithmArgH)

  Return the name of an argument.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    argument name whose lifetime is bound to hArg and which must not be freed.

GDALAlgorithmArgType GDALAlgorithmArgGetType(GDALAlgorithmArgH)

  Get the type of an argument.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

const char *GDALAlgorithmArgGetDescription(GDALAlgorithmArgH)

  Return the description of an argument.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    argument description whose lifetime is bound to hArg and which must not be freed.

const char *GDALAlgorithmArgGetShortName(GDALAlgorithmArgH)

  Return the short name, or empty string if there is none.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    short name whose lifetime is bound to hArg and which must not be freed.

char **GDALAlgorithmArgGetAliases(GDALAlgorithmArgH)

  Return the aliases (potentially none)

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

const char *GDALAlgorithmArgGetMetaVar(GDALAlgorithmArgH)

  Return the "meta-var" hint.

  By default, the meta-var value is the long name of the argument in upper case.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    meta-var hint whose lifetime is bound to hArg and which must not be freed.

const char *GDALAlgorithmArgGetCategory(GDALAlgorithmArgH)

  Return the argument category.

  GAAC_COMMON, GAAC_BASE, GAAC_ADVANCED, GAAC_ESOTERIC or a custom category.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    category whose lifetime is bound to hArg and which must not be freed.

bool GDALAlgorithmArgIsPositional(GDALAlgorithmArgH)

  Return if the argument is a positional one.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgIsRequired(GDALAlgorithmArgH)

  Return whether the argument is required.

  Defaults to false.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

int GDALAlgorithmArgGetMinCount(GDALAlgorithmArgH)

  Return the minimum number of values for the argument.

  Defaults to 0. Only applies to list type of arguments.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

int GDALAlgorithmArgGetMaxCount(GDALAlgorithmArgH)

  Return the maximum number of values for the argument.

  Defaults to 1 for scalar types, and INT_MAX for list types. Only applies to list type of arguments.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgGetPackedValuesAllowed(GDALAlgorithmArgH)

  Return whether, for list type of arguments, several values, space separated, may be specified.

  That is "--foo=bar,baz". The default is true.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgGetRepeatedArgAllowed(GDALAlgorithmArgH)

  Return whether, for list type of arguments, the argument may be repeated.

  That is "--foo=bar --foo=baz". The default is true.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

char **GDALAlgorithmArgGetChoices(GDALAlgorithmArgH)

  Return the allowed values (as strings) for the argument.

  Only honored for GAAT_STRING and GAAT_STRING_LIST types.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

char **GDALAlgorithmArgGetMetadataItem(GDALAlgorithmArgH, const char*)

  Return the values of the metadata item of an argument.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - pszItem -- Name of the item. Must NOT be null.

  Returns:

    a NULL terminated list of values, which must be destroyed with CSLDestroy()

bool GDALAlgorithmArgIsExplicitlySet(GDALAlgorithmArgH)

  Return whether the argument value has been explicitly set with Set()

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgHasDefaultValue(GDALAlgorithmArgH)

  Return if the argument has a declared default value.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgGetDefaultAsBoolean(GDALAlgorithmArgH)

  Return the argument default value as a integer.

  Must only be called on arguments whose type is GAAT_BOOLEAN

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

const char *GDALAlgorithmArgGetDefaultAsString(GDALAlgorithmArgH)

  Return the argument default value as a string.

  Must only be called on arguments whose type is GAAT_STRING.

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    string whose lifetime is bound to hArg and which must not be freed.

int GDALAlgorithmArgGetDefaultAsInteger(GDALAlgorithmArgH)

  Return the argument default value as a integer.

  Must only be called on arguments whose type is GAAT_INTEGER

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

double GDALAlgorithmArgGetDefaultAsDouble(GDALAlgorithmArgH)

  Return the argument default value as a double.

  Must only be called on arguments whose type is GAAT_REAL

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

char **GDALAlgorithmArgGetDefaultAsStringList(GDALAlgorithmArgH)

  Return the argument default value as a string list.

  Must only be called on arguments whose type is GAAT_STRING_LIST.

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

const int *GDALAlgorithmArgGetDefaultAsIntegerList(GDALAlgorithmArgH, size_t *pnCount)

  Return the argument default value as a integer list.

  Must only be called on arguments whose type is GAAT_INTEGER_LIST.

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - pnCount -- [out] Pointer to the number of values in the list. Must NOT be null.

const double *GDALAlgorithmArgGetDefaultAsDoubleList(GDALAlgorithmArgH, size_t *pnCount)

  Return the argument default value as a real list.

  Must only be called on arguments whose type is GAAT_REAL_LIST.

  GDALAlgorithmArgHasDefaultValue() must be called to determine if the argument has a default value.

  Since

    3.12

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - pnCount -- [out] Pointer to the number of values in the list. Must NOT be null.

bool GDALAlgorithmArgIsHidden(GDALAlgorithmArgH)

  Return whether the argument is hidden (for GDAL internal use)

  This is an alias for GDALAlgorithmArgIsHiddenForCLI() && GDALAlgorithmArgIsHiddenForAPI().

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgIsHiddenForCLI(GDALAlgorithmArgH)

  Return whether the argument must not be mentioned in CLI usage.

  For example, "output-value" for "gdal raster info", which is only meant when the algorithm is used from a non-CLI context.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgIsHiddenForAPI(GDALAlgorithmArgH)

  Return whether the argument must not be mentioned in the context of an API use.

  Said otherwise, if it is only for CLI usage.

  For example "--help"

  Since

    3.12

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgIsInput(GDALAlgorithmArgH)

  Indicate whether the value of the argument is read-only during the execution of the algorithm.

  Default is true.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

bool GDALAlgorithmArgIsOutput(GDALAlgorithmArgH)

  Return whether (at least part of) the value of the argument is set during the execution of the algorithm.

  For example, "output-value" for "gdal raster info" Default is false. An argument may return both IsInput() and IsOutput() as true. For example the "gdal raster convert" algorithm consumes the dataset name of its "output" argument, and sets the dataset object during its execution.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

const char *GDALAlgorithmArgGetMutualExclusionGroup(GDALAlgorithmArgH)

  Return the name of the mutual exclusion group to which this argument belongs to.

  Or empty string if it does not belong to any exclusion group.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    string whose lifetime is bound to hArg and which must not be freed.

bool GDALAlgorithmArgGetAsBoolean(GDALAlgorithmArgH)

  Return the argument value as a boolean.

  Must only be called on arguments whose type is GAAT_BOOLEAN.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

const char *GDALAlgorithmArgGetAsString(GDALAlgorithmArgH)

  Return the argument value as a string.

  Must only be called on arguments whose type is GAAT_STRING.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    string whose lifetime is bound to hArg and which must not be freed.

GDALArgDatasetValueH GDALAlgorithmArgGetAsDatasetValue(GDALAlgorithmArgH)

  Return the argument value as a GDALArgDatasetValueH.

  Must only be called on arguments whose type is GAAT_DATASET

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    handle to a GDALArgDatasetValue that must be released with GDALArgDatasetValueRelease(). The lifetime of that handle does not exceed the one of hArg.

int GDALAlgorithmArgGetAsInteger(GDALAlgorithmArgH)

  Return the argument value as a integer.

  Must only be called on arguments whose type is GAAT_INTEGER

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

double GDALAlgorithmArgGetAsDouble(GDALAlgorithmArgH)

  Return the argument value as a double.

  Must only be called on arguments whose type is GAAT_REAL

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

char **GDALAlgorithmArgGetAsStringList(GDALAlgorithmArgH)

  Return the argument value as a string list.

  Must only be called on arguments whose type is GAAT_STRING_LIST.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    a NULL terminated list of names, which must be destroyed with CSLDestroy()

const int *GDALAlgorithmArgGetAsIntegerList(GDALAlgorithmArgH, size_t *pnCount)

  Return the argument value as a integer list.

  Must only be called on arguments whose type is GAAT_INTEGER_LIST.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - pnCount -- [out] Pointer to the number of values in the list. Must NOT be null.

const double *GDALAlgorithmArgGetAsDoubleList(GDALAlgorithmArgH, size_t *pnCount)

  Return the argument value as a real list.

  Must only be called on arguments whose type is GAAT_REAL_LIST.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - pnCount -- [out] Pointer to the number of values in the list. Must NOT be null.

bool GDALAlgorithmArgSetAsBoolean(GDALAlgorithmArgH, bool)

  Set the value for a GAAT_BOOLEAN argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- value.

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsString(GDALAlgorithmArgH, const char*)

  Set the value for a GAAT_STRING argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- value (may be null)

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsDatasetValue(GDALAlgorithmArgH hArg, GDALArgDatasetValueH value)

  Set the value for a GAAT_DATASET argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- Handle to a GDALArgDatasetValue. Must NOT be null.

  Returns:

    true if success.

bool GDALAlgorithmArgSetDataset(GDALAlgorithmArgH hArg, GDALDatasetH)

  Set dataset object, increasing its reference counter.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - hDS -- Dataset object. May be null.

  Returns:

    true if success.

bool GDALAlgorithmArgSetDatasets(GDALAlgorithmArgH hArg, size_t nCount, GDALDatasetH*)

  Set dataset objects to a GAAT_DATASET_LIST argument, increasing their reference counter.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - nCount -- Number of values in pnValues.

    - pahDS -- Pointer to an array of dataset of size nCount.

  Returns:

    true if success.

bool GDALAlgorithmArgSetDatasetNames(GDALAlgorithmArgH hArg, CSLConstList)

  Set dataset names to a GAAT_DATASET_LIST argument.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - names -- Dataset names as a NULL terminated list (may be null)

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsInteger(GDALAlgorithmArgH, int)

  Set the value for a GAAT_INTEGER (or GAAT_REAL) argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- value.

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsDouble(GDALAlgorithmArgH, double)

  Set the value for a GAAT_REAL argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- value.

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsStringList(GDALAlgorithmArgH, CSLConstList)

  Set the value for a GAAT_STRING_LIST argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - value -- value as a NULL terminated list (may be null)

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsIntegerList(GDALAlgorithmArgH, size_t nCount, const int *pnValues)

  Set the value for a GAAT_INTEGER_LIST argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - nCount -- Number of values in pnValues.

    - pnValues -- Pointer to an array of integer values of size nCount.

  Returns:

    true if success.

bool GDALAlgorithmArgSetAsDoubleList(GDALAlgorithmArgH, size_t nCount, const double *pnValues)

  Set the value for a GAAT_REAL_LIST argument.

  It cannot be called several times for a given argument. Validation checks and other actions are run.

  Since

    3.11

  Parameters:

    - hArg -- Handle to an argument. Must NOT be null.

    - nCount -- Number of values in pnValues.

    - pnValues -- Pointer to an array of double values of size nCount.

  Returns:

    true if success.

GDALArgDatasetType GDALAlgorithmArgGetDatasetType(GDALAlgorithmArgH)

  Get which type of dataset is allowed / generated.

  Binary-or combination of GDAL_OF_RASTER, GDAL_OF_VECTOR and GDAL_OF_MULTIDIM_RASTER. Only applies to arguments of type GAAT_DATASET or GAAT_DATASET_LIST.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

int GDALAlgorithmArgGetDatasetInputFlags(GDALAlgorithmArgH)

  Indicates which components among name and dataset are accepted as input, when this argument serves as an input.

  If the GADV_NAME bit is set, it indicates a dataset name is accepted as input. If the GADV_OBJECT bit is set, it indicates a dataset object is accepted as input. If both bits are set, the algorithm can accept either a name or a dataset object. Only applies to arguments of type GAAT_DATASET or GAAT_DATASET_LIST.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    string whose lifetime is bound to hAlg and which must not be freed.

int GDALAlgorithmArgGetDatasetOutputFlags(GDALAlgorithmArgH)

  Indicates which components among name and dataset are modified, when this argument serves as an output.

  If the GADV_NAME bit is set, it indicates a dataset name is generated as output (that is the algorithm will generate the name. Rarely used). If the GADV_OBJECT bit is set, it indicates a dataset object is generated as output, and available for use after the algorithm has completed. Only applies to arguments of type GAAT_DATASET or GAAT_DATASET_LIST.

  Since

    3.11

  Parameters:

    hArg -- Handle to an argument. Must NOT be null.

  Returns:

    string whose lifetime is bound to hAlg and which must not be freed.

GDALArgDatasetValueH GDALArgDatasetValueCreate(void)

  Instantiate an empty GDALArgDatasetValue.

  Since

    3.11

  Returns:

    new handle to free with GDALArgDatasetValueRelease()

void GDALArgDatasetValueRelease(GDALArgDatasetValueH)

  Release a handle to a GDALArgDatasetValue.

  Since

    3.11

const char *GDALArgDatasetValueGetName(GDALArgDatasetValueH)

  Return the name component of the GDALArgDatasetValue.

  Since

    3.11

  Parameters:

    hValue -- Handle to a GDALArgDatasetValue. Must NOT be null.

  Returns:

    string whose lifetime is bound to hAlg and which must not be freed.

GDALDatasetH GDALArgDatasetValueGetDatasetRef(GDALArgDatasetValueH)

  Return the dataset component of the GDALArgDatasetValue.

  This does not modify the reference counter, hence the lifetime of the returned object is not guaranteed to exceed the one of hValue.

  Since

    3.11

  Parameters:

    hValue -- Handle to a GDALArgDatasetValue. Must NOT be null.

GDALDatasetH GDALArgDatasetValueGetDatasetIncreaseRefCount(GDALArgDatasetValueH)

  Return the dataset component of the GDALArgDatasetValue, and increase its reference count if not null.

  Once done with the dataset, the caller should call GDALReleaseDataset().

  Since

    3.11

  Parameters:

    hValue -- Handle to a GDALArgDatasetValue. Must NOT be null.

void GDALArgDatasetValueSetName(GDALArgDatasetValueH, const char*)

  Set dataset name.

  Since

    3.11

  Parameters:

    - hValue -- Handle to a GDALArgDatasetValue. Must NOT be null.

    - pszName -- Dataset name. May be null.

void GDALArgDatasetValueSetDataset(GDALArgDatasetValueH, GDALDatasetH)

  Set dataset object, increasing its reference counter.

  Since

    3.11

  Parameters:

    - hValue -- Handle to a GDALArgDatasetValue. Must NOT be null.

    - hDS -- Dataset object. May be null.