Handling of command-line parameters in Initializer is not consistent
To run Initializer, One needs to provide a series of command-line parameters. These are the search pattern for the exposure model files to be imported, the country ISO code, and the PostGIS config file to access the server-based database either for retrieving tiles and boundaries (if importing into a SpatiaLite database) or for writing the model into the database (if importing into a PostGIS database).
The PostGIS config file and the search pattern for the exposure model files are provided as parameters when instantiating the ExposureInitializer
object and are stored as member variables. The member variable for the search pattern of the exposure model files is not used at all but again provided as parameter for the import_exposure()
function. This and other functions also need the country ISO code as a parameter.
I suggest that either all relevant parameters are provided in the constructor of the ExposureInitializer
class or all are provided in the functions to process the import. This mixture is rather confusing.
The advantage of providing all parameters in the constructor is that the following code in the command_line_interface()
function will be better readable because the many parameters per function call do not need to be specified anymore.
The advantage of providing the parameters for each function as needed is that one could write a little program that uses the ExposureInitializer
class to subsequently import a series of countries by repeatedly calling the import_exposure()
function.
Please indicate your preference!