MCPcopy Create free account
hub / github.com/OSGeo/gdal / RunStep

Method RunStep

apps/gdalalg_vector_export_schema.cpp:56–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54/************************************************************************/
55
56bool GDALVectorExportSchemaAlgorithm::RunStep(GDALPipelineStepRunContext &)
57{
58 CPLAssert(m_inputDataset.size() == 1);
59 auto poSrcDS = m_inputDataset[0].GetDatasetRef();
60 CPLAssert(poSrcDS);
61
62 CPLStringList aosOptions;
63
64 aosOptions.AddString("-schema");
65 aosOptions.AddString("--cli");
66
67 // Must be last, as positional
68 aosOptions.AddString("dummy");
69
70 for (const std::string &name : m_layerNames)
71 aosOptions.AddString(name.c_str());
72
73 if (m_layerNames.empty())
74 {
75 aosOptions.AddString("-al");
76 }
77
78 GDALVectorInfoOptions *psInfo =
79 GDALVectorInfoOptionsNew(aosOptions.List(), nullptr);
80
81 char *ret = GDALVectorInfo(GDALDataset::ToHandle(poSrcDS), psInfo);
82 GDALVectorInfoOptionsFree(psInfo);
83 if (!ret)
84 return false;
85
86 m_output = ret;
87 CPLFree(ret);
88
89 return true;
90}
91
92GDALVectorExportSchemaAlgorithmStandalone::
93 ~GDALVectorExportSchemaAlgorithmStandalone() = default;

Callers

nothing calls this directly

Calls 8

GDALVectorInfoOptionsNewFunction · 0.85
GDALVectorInfoFunction · 0.85
ListMethod · 0.80
ToHandleFunction · 0.50
sizeMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected