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