]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/config.py
port address level computation to Python
[nominatim.git] / nominatim / config.py
index 458c828f58fce8adeda02fd550823641366ceb2c..d4ba0d7a1eb59c3a2aaa6cbfb90c22ae641876db 100644 (file)
@@ -24,6 +24,13 @@ class Configuration:
         if project_dir is not None:
             self._config.update(dotenv_values(str((project_dir / '.env').resolve())))
 
+        # Add defaults for variables that are left empty to set the default.
+        # They may still be overwritten by environment variables.
+        if not self._config['NOMINATIM_ADDRESS_LEVEL_CONFIG']:
+            self._config['NOMINATIM_ADDRESS_LEVEL_CONFIG'] = \
+                str(config_dir / 'address-levels.json')
+
+
     def __getattr__(self, name):
         name = 'NOMINATIM_' + name