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

Method GDALVectorEditAlgorithm

apps/gdalalg_vector_edit.cpp:28–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26/************************************************************************/
27
28GDALVectorEditAlgorithm::GDALVectorEditAlgorithm(bool standaloneStep)
29 : GDALVectorPipelineStepAlgorithm(
30 NAME, DESCRIPTION, HELP_URL,
31 ConstructorOptions()
32 .SetStandaloneStep(standaloneStep)
33 .SetOutputLayerNameAvailableInPipelineStep(true))
34{
35 AddActiveLayerArg(&m_activeLayer);
36 if (!standaloneStep)
37 {
38 AddOutputLayerNameArg(/* hiddenForCLI = */ false,
39 /* shortNameOutputLayerAllowed = */ false);
40 }
41
42 AddGeometryTypeArg(&m_geometryType, _("Layer geometry type"));
43
44 AddArg("crs", 0, _("Override CRS (without reprojection)"), &m_overrideCrs)
45 .AddHiddenAlias("a_srs")
46 .SetIsCRSArg(/*noneAllowed=*/true);
47
48 {
49 auto &arg = AddArg("metadata", 0, _("Add/update dataset metadata item"),
50 &m_metadata)
51 .SetMetaVar("<KEY>=<VALUE>")
52 .SetPackedValuesAllowed(false);
53 arg.AddValidationAction([this, &arg]()
54 { return ParseAndValidateKeyValue(arg); });
55 arg.AddHiddenAlias("mo");
56 }
57
58 AddArg("unset-metadata", 0, _("Remove dataset metadata item"),
59 &m_unsetMetadata)
60 .SetMetaVar("<KEY>");
61
62 {
63 auto &arg =
64 AddArg("layer-metadata", 0, _("Add/update layer metadata item"),
65 &m_layerMetadata)
66 .SetMetaVar("<KEY>=<VALUE>")
67 .SetPackedValuesAllowed(false);
68 arg.AddValidationAction([this, &arg]()
69 { return ParseAndValidateKeyValue(arg); });
70 }
71
72 AddArg("unset-layer-metadata", 0, _("Remove layer metadata item"),
73 &m_unsetLayerMetadata)
74 .SetMetaVar("<KEY>");
75
76 AddArg("unset-fid", 0,
77 _("Unset the identifier of each feature and the FID column name"),
78 &m_unsetFID);
79
80 AddValidationAction(
81 [this]()
82 {
83 if (!m_outputLayerName.empty() && m_activeLayer.empty() &&
84 m_inputDataset.size() == 1)
85 {

Callers

nothing calls this directly

Calls 6

ConstructorOptionsClass · 0.85
AddValidationActionFunction · 0.85
ReportErrorFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
GetLayerCountMethod · 0.45

Tested by

no test coverage detected