| 26 | /************************************************************************/ |
| 27 | |
| 28 | GDALVectorUpdateAlgorithm::GDALVectorUpdateAlgorithm(bool standaloneStep) |
| 29 | : GDALVectorPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL, |
| 30 | ConstructorOptions() |
| 31 | .SetStandaloneStep(standaloneStep) |
| 32 | .SetInputDatasetMaxCount(1) |
| 33 | .SetAddInputLayerNameArgument(false) |
| 34 | .SetAddDefaultArguments(false)) |
| 35 | { |
| 36 | if (standaloneStep) |
| 37 | { |
| 38 | AddVectorInputArgs(false); |
| 39 | } |
| 40 | else |
| 41 | { |
| 42 | AddVectorHiddenInputDatasetArg(); |
| 43 | } |
| 44 | |
| 45 | { |
| 46 | auto &layerArg = AddArg(GDAL_ARG_NAME_INPUT_LAYER, 0, |
| 47 | _("Input layer name"), &m_inputLayerNames) |
| 48 | .SetMaxCount(1); |
| 49 | auto inputArg = GetArg(GDAL_ARG_NAME_INPUT); |
| 50 | if (inputArg) |
| 51 | SetAutoCompleteFunctionForLayerName(layerArg, *inputArg); |
| 52 | } |
| 53 | |
| 54 | AddProgressArg(); |
| 55 | |
| 56 | AddOutputDatasetArg(&m_outputDataset, GDAL_OF_VECTOR) |
| 57 | .SetDatasetInputFlags(GADV_NAME | GADV_OBJECT); |
| 58 | AddOutputOpenOptionsArg(&m_outputOpenOptions); |
| 59 | AddOutputLayerNameArg(&m_outputLayerName); |
| 60 | |
| 61 | m_update = true; |
| 62 | AddUpdateArg(&m_update).SetDefault(true).SetHidden(); |
| 63 | |
| 64 | AddArg("mode", 0, _("Set update mode"), &m_mode) |
| 65 | .SetDefault(m_mode) |
| 66 | .SetChoices(MODE_MERGE, MODE_UPDATE_ONLY, MODE_APPEND_ONLY); |
| 67 | |
| 68 | AddArg("key", 0, _("Field(s) used as a key to identify features"), &m_key) |
| 69 | .SetPackedValuesAllowed(false); |
| 70 | } |
| 71 | |
| 72 | /************************************************************************/ |
| 73 | /* GDALVectorUpdateAlgorithm::RunStep() */ |
nothing calls this directly
no test coverage detected