Skip to content

JSON configuration

The options and settings for executing a citydb-tool command can be defined in a JSON-encoded configuration file, offering an alternative to manually specifying them via the command line. The configuration file organizes options into functional sections, with each command using one or more sections based on its specific task and operation.

The example below illustrates the basic structure of the configuration file, highlighting the main sections. A configuration file can include all sections for reusability across different commands, or it may contain only the sections needed for a specific command.

{
  "databaseOptions": {...},
  "importOptions": {...},
  "readOptions": {...},
  "exportOptions": {...},
  "writeOptions": {...},
  "deleteOptions": {...},
  ...
}

The purpose of each configuration section is outlined below. Their content and usage for different citydb-tool commands are explained in more detail in the following chapters.

Section
Description
"databaseOptions" Defines connection details for one or more 3DCityDB instances, usable by all commands that require a database connection.
"importOptions" Defines options for controlling the import process.
"readOptions" Specifies settings for reading input files, including format-specific options.
"exportOptions" Defines options for controlling the export process.
"writeOptions" Specifies settings for writing output files, including format-specific options.
"deleteOptions" Defines options for controlling the delete process.

You can load configuration files using the --config-file option when executing citydb-tool commands.

./citydb import citygml \
    --config-file=/path/to/my-config.json \
    my-city.gml
citydb import citygml ^
    --config-file=C:\path\to\my-config.json ^
    my-city.gml

Tip

  • Configuration files can be used alongside command-line options for flexibility. However, command-line options always take precedence.
  • Some commands may provide options exclusively in the JSON configuration, without corresponding command-line options.
  • If plugins are registered for citydb-tool, they may extend the configuration by adding their own sections.