| 33 | /************************************************************************/ |
| 34 | |
| 35 | GDALVectorIndexAlgorithm::GDALVectorIndexAlgorithm() |
| 36 | : GDALVectorOutputAbstractAlgorithm(NAME, DESCRIPTION, HELP_URL) |
| 37 | { |
| 38 | AddProgressArg(); |
| 39 | AddInputDatasetArg(&m_inputDatasets, GDAL_OF_VECTOR) |
| 40 | .SetAutoOpenDataset(false) |
| 41 | .SetDatasetInputFlags(GADV_NAME); |
| 42 | GDALVectorOutputAbstractAlgorithm::AddAllOutputArgs(); |
| 43 | |
| 44 | AddArg("recursive", 0, |
| 45 | _("Whether input directories should be explored recursively."), |
| 46 | &m_recursive); |
| 47 | AddArg("filename-filter", 0, |
| 48 | _("Pattern that the filenames in input directories should follow " |
| 49 | "('*' and '?' wildcard)"), |
| 50 | &m_filenameFilter); |
| 51 | AddArg("location-name", 0, _("Name of the field with the vector path"), |
| 52 | &m_locationName) |
| 53 | .SetDefault(m_locationName) |
| 54 | .SetMinCharCount(1); |
| 55 | AddAbsolutePathArg( |
| 56 | &m_writeAbsolutePaths, |
| 57 | _("Whether the path to the input datasets should be stored as an " |
| 58 | "absolute path")); |
| 59 | AddArg(GDAL_ARG_NAME_OUTPUT_CRS, 0, _("Output CRS"), &m_crs) |
| 60 | .SetIsCRSArg() |
| 61 | .AddHiddenAlias("dst-crs") |
| 62 | .AddHiddenAlias("t_srs"); |
| 63 | |
| 64 | { |
| 65 | auto &arg = |
| 66 | AddArg("metadata", 0, _("Add dataset metadata item"), &m_metadata) |
| 67 | .SetMetaVar("<KEY>=<VALUE>") |
| 68 | .SetPackedValuesAllowed(false); |
| 69 | arg.AddValidationAction([this, &arg]() |
| 70 | { return ParseAndValidateKeyValue(arg); }); |
| 71 | arg.AddHiddenAlias("mo"); |
| 72 | } |
| 73 | AddArg("source-crs-field-name", 0, |
| 74 | _("Name of the field to store the CRS of each dataset"), |
| 75 | &m_sourceCrsName) |
| 76 | .SetMinCharCount(1); |
| 77 | auto &sourceCRSFormatArg = |
| 78 | AddArg("source-crs-format", 0, |
| 79 | _("Format in which the CRS of each dataset must be written"), |
| 80 | &m_sourceCrsFormat) |
| 81 | .SetMinCharCount(1) |
| 82 | .SetDefault(m_sourceCrsFormat) |
| 83 | .SetChoices("auto", "WKT", "EPSG", "PROJ"); |
| 84 | AddArg("source-layer-name", 0, |
| 85 | _("Add layer of specified name from each source file in the tile " |
| 86 | "index"), |
| 87 | &m_layerNames); |
| 88 | AddArg("source-layer-index", 0, |
| 89 | _("Add layer of specified index (0-based) from each source file in " |
| 90 | "the tile index"), |
| 91 | &m_layerIndices); |
| 92 | AddArg("accept-different-crs", 0, |
nothing calls this directly
no test coverage detected