/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_compare.h" |
19 | | #include "gdalalg_mdim_convert.h" |
20 | | #include "gdalalg_mdim_mosaic.h" |
21 | | #include "gdalalg_mdim_pipeline.h" |
22 | | #include "gdalalg_mdim_reproject.h" |
23 | | |
24 | | #include "gdal_priv.h" |
25 | | |
26 | | #ifndef _ |
27 | 0 | #define _(x) (x) |
28 | | #endif |
29 | | |
30 | | /************************************************************************/ |
31 | | /* GDALMdimAlgorithm */ |
32 | | /************************************************************************/ |
33 | | |
34 | | GDALMdimAlgorithm::GDALMdimAlgorithm() |
35 | 0 | : GDALAlgorithm(NAME, DESCRIPTION, HELP_URL) |
36 | 0 | { |
37 | 0 | AddArg("drivers", 0, |
38 | 0 | _("Display multidimensional driver list as JSON document"), |
39 | 0 | &m_drivers); |
40 | |
|
41 | 0 | AddOutputStringArg(&m_output); |
42 | |
|
43 | 0 | RegisterSubAlgorithm<GDALMdimInfoAlgorithmStandalone>(); |
44 | 0 | RegisterSubAlgorithm<GDALMdimCompareAlgorithmStandalone>(); |
45 | 0 | RegisterSubAlgorithm<GDALMdimConvertAlgorithm>(); |
46 | 0 | RegisterSubAlgorithm<GDALMdimMosaicAlgorithmStandalone>(); |
47 | 0 | RegisterSubAlgorithm<GDALMdimPipelineAlgorithm>(); |
48 | 0 | RegisterSubAlgorithm<GDALMdimReprojectAlgorithmStandalone>(); |
49 | 0 | } |
50 | | |
51 | | bool GDALMdimAlgorithm::RunImpl(GDALProgressFunc, void *) |
52 | 0 | { |
53 | 0 | if (m_drivers) |
54 | 0 | { |
55 | 0 | m_output = GDALPrintDriverList(GDAL_OF_MULTIDIM_RASTER, true); |
56 | 0 | return true; |
57 | 0 | } |
58 | 0 | else |
59 | 0 | { |
60 | 0 | CPLError(CE_Failure, CPLE_AppDefined, |
61 | 0 | "The Run() method should not be called directly on the \"gdal " |
62 | 0 | "mdim\" program."); |
63 | 0 | return false; |
64 | 0 | } |
65 | 0 | } |
66 | | |
67 | | //! @endcond |