@@ -2914,13 +2914,15 @@ GDALInConstructionAlgorithmArg &
2914
2914
GDALAlgorithm::AddOutputDataTypeArg (std::string *pValue,
2915
2915
const char *helpMessage)
2916
2916
{
2917
- auto &arg = AddArg (GDAL_ARG_NAME_OUTPUT_DATA_TYPE, 0 ,
2918
- MsgOrDefault (helpMessage, _ (" Output data type" )), pValue)
2919
- .AddAlias (" ot" )
2920
- .AddAlias (" datatype" )
2921
- .SetChoices (" Byte" , " Int8" , " UInt16" , " Int16" , " UInt32" ,
2922
- " Int32" , " UInt64" , " Int64" , " CInt16" , " CInt32" ,
2923
- " Float32" , " Float64" , " CFloat32" , " CFloat64" );
2917
+ auto &arg =
2918
+ AddArg (GDAL_ARG_NAME_OUTPUT_DATA_TYPE, 0 ,
2919
+ MsgOrDefault (helpMessage, _ (" Output data type" )), pValue)
2920
+ .AddAlias (" ot" )
2921
+ .AddAlias (" datatype" )
2922
+ .AddMetadataItem (" type" , {" GDALDataType" })
2923
+ .SetChoices (" Byte" , " Int8" , " UInt16" , " Int16" , " UInt32" , " Int32" ,
2924
+ " UInt64" , " Int64" , " CInt16" , " CInt32" , " Float16" ,
2925
+ " Float32" , " Float64" , " CFloat32" , " CFloat64" );
2924
2926
return arg;
2925
2927
}
2926
2928
@@ -4911,6 +4913,28 @@ char **GDALAlgorithmArgGetChoices(GDALAlgorithmArgH hArg)
4911
4913
return CPLStringList (hArg->ptr ->GetChoices ()).StealList ();
4912
4914
}
4913
4915
4916
+ /* ***********************************************************************/
4917
+ /* GDALAlgorithmArgGetMetadataItem() */
4918
+ /* ***********************************************************************/
4919
+
4920
+ /* * Return the values of the metadata item of an argument.
4921
+ *
4922
+ * @param hArg Handle to an argument. Must NOT be null.
4923
+ * @param pszItem Name of the item. Must NOT be null.
4924
+ * @return a NULL terminated list of values, which must be destroyed with
4925
+ * CSLDestroy()
4926
+
4927
+ * @since 3.11
4928
+ */
4929
+ char **GDALAlgorithmArgGetMetadataItem (GDALAlgorithmArgH hArg,
4930
+ const char *pszItem)
4931
+ {
4932
+ VALIDATE_POINTER1 (hArg, __func__, nullptr );
4933
+ VALIDATE_POINTER1 (pszItem, __func__, nullptr );
4934
+ const auto pVecOfStrings = hArg->ptr ->GetMetadataItem (pszItem);
4935
+ return pVecOfStrings ? CPLStringList (*pVecOfStrings).StealList () : nullptr ;
4936
+ }
4937
+
4914
4938
/* ***********************************************************************/
4915
4939
/* GDALAlgorithmArgIsExplicitlySet() */
4916
4940
/* ***********************************************************************/
0 commit comments