1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
/******************************************************************************
*
* Project: GDAL
* Purpose: gdal "mdim" subcommand
* Author: Even Rouault <even dot rouault at spatialys.com>
*
******************************************************************************
* Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
*
* SPDX-License-Identifier: MIT
****************************************************************************/
//! @cond Doxygen_Suppress
#include "gdalalg_mdim.h"
#include "gdalalg_mdim_info.h"
#include "gdalalg_mdim_convert.h"
#include "gdalalg_mdim_mosaic.h"
#include "gdal_priv.h"
#ifndef _
#define _(x) (x)
#endif
/************************************************************************/
/* GDALMdimAlgorithm */
/************************************************************************/
GDALMdimAlgorithm::GDALMdimAlgorithm()
: GDALAlgorithm(NAME, DESCRIPTION, HELP_URL)
{
AddArg("drivers", 0,
_("Display multidimensional driver list as JSON document"),
&m_drivers);
AddOutputStringArg(&m_output);
RegisterSubAlgorithm<GDALMdimInfoAlgorithm>();
RegisterSubAlgorithm<GDALMdimConvertAlgorithm>();
RegisterSubAlgorithm<GDALMdimMosaicAlgorithm>();
}
bool GDALMdimAlgorithm::RunImpl(GDALProgressFunc, void *)
{
if (m_drivers)
{
m_output = GDALPrintDriverList(GDAL_OF_MULTIDIM_RASTER, true);
return true;
}
else
{
CPLError(CE_Failure, CPLE_AppDefined,
"The Run() method should not be called directly on the \"gdal "
"mdim\" program.");
return false;
}
}
//! @endcond
|