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

Method GDALVectorInfoAlgorithm

apps/gdalalg_vector_info.cpp:29–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27/************************************************************************/
28
29GDALVectorInfoAlgorithm::GDALVectorInfoAlgorithm(bool standaloneStep)
30 : GDALVectorPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL,
31 ConstructorOptions()
32 .SetStandaloneStep(standaloneStep)
33 .SetInputDatasetMaxCount(1)
34 .SetAddDefaultArguments(false))
35{
36 AddOutputFormatArg(&m_format).SetChoices("json", "text");
37 AddOpenOptionsArg(&m_openOptions).SetHiddenForCLI(!standaloneStep);
38 AddInputFormatsArg(&m_inputFormats)
39 .AddMetadataItem(GAAMDI_REQUIRED_CAPABILITIES, {GDAL_DCAP_VECTOR})
40 .SetHiddenForCLI(!standaloneStep);
41
42 auto &datasetArg =
43 AddInputDatasetArg(&m_inputDataset, GDAL_OF_VECTOR).AddAlias("dataset");
44 if (!standaloneStep)
45 datasetArg.SetHidden();
46 auto &layerArg = AddLayerNameArg(&m_layerNames)
47 .SetMutualExclusionGroup("layer-sql")
48 .AddAlias("layer");
49 SetAutoCompleteFunctionForLayerName(layerArg, datasetArg);
50 auto &argFeature =
51 AddArg(
52 "features", 0,
53 _("List all features (beware of RAM consumption on large layers)"),
54 &m_listFeatures)
55 .SetMutualExclusionGroup("summary-features");
56 AddArg("summary", 0, _("List the layer names and the geometry type"),
57 &m_summaryOnly)
58 .SetMutualExclusionGroup("summary-features");
59 AddArg("limit", 0,
60 _("Limit the number of features per layer (implies --features)"),
61 &m_limit)
62 .SetMinValueIncluded(0)
63 .SetMetaVar("FEATURE-COUNT")
64 .AddAction([&argFeature]() { argFeature.Set(true); });
65 AddArg("sql", 0,
66 _("Execute the indicated SQL statement and return the result"),
67 &m_sql)
68 .SetReadFromFileAtSyntaxAllowed()
69 .SetMetaVar("<statement>|@<filename>")
70 .SetRemoveSQLCommentsEnabled()
71 .SetMutualExclusionGroup("layer-sql");
72 AddArg("where", 0,
73 _("Attribute query in a restricted form of the queries used in the "
74 "SQL WHERE statement"),
75 &m_where)
76 .SetReadFromFileAtSyntaxAllowed()
77 .SetMetaVar("<WHERE>|@<filename>")
78 .SetRemoveSQLCommentsEnabled();
79 AddArg("fid", 0, _("Feature identifier"), &m_fid)
80 .SetMetaVar("FID")
81 .SetMutualExclusionGroup("layer-sql");
82 AddArg("dialect", 0, _("SQL dialect"), &m_dialect);
83 AddOutputStringArg(&m_output);
84 AddStdoutArg(&m_stdout);
85 AddArg("crs-format", 0, _("Which format to use to report CRS"),
86 &m_crsFormat)

Callers

nothing calls this directly

Calls 7

ConstructorOptionsClass · 0.85
AddValidationActionFunction · 0.85
SetCategoryMethod · 0.80
SetDefaultMethod · 0.80
ReportErrorFunction · 0.50
SetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected