Compare commits

...

2 Commits

Author SHA1 Message Date
Sarah Hoffmann
1ab4d445ea Merge pull request #3762 from lonvia/remove-gazetteer-output-support
Remove support for deprecated gazetteer osm2pgsql output
2025-06-26 20:28:16 +02:00
Sarah Hoffmann
f9eb93c4ab remove support for deprecated gazetteer osm2pgsql output 2025-06-25 23:09:08 +02:00
7 changed files with 18 additions and 32 deletions

View File

@@ -556,16 +556,6 @@ the Nominatim topic.
```
Discarding country-level boundaries when running under themepark.
## osm2pgsql gazetteer output
Nominatim still allows you to configure the gazetteer output to remain
backwards compatible with older imports. It will be automatically used
when the style file name ends in `.style`. For documentation of the
old import style, please refer to the documentation of older releases
of Nominatim. Do not use the gazetteer output for new imports. There is no
guarantee that new versions of Nominatim are fully compatible with the
gazetteer output.
## Changing the style of existing databases
There is usually no issue changing the style of a database that is already

View File

@@ -3,8 +3,7 @@
### Import tables
OSM data is initially imported using [osm2pgsql](https://osm2pgsql.org).
Nominatim uses its own data output style 'gazetteer', which differs from the
output style created for map rendering.
Nominatim uses a custom flex style to create the initial import tables.
The import process creates the following tables:
@@ -14,7 +13,7 @@ The `planet_osm_*` tables are the usual backing tables for OSM data. Note
that Nominatim uses them to look up special relations and to find nodes on
ways.
The gazetteer style produces a single table `place` as output with the following
The osm2pgsql import produces a single table `place` as output with the following
columns:
* `osm_type` - kind of OSM object (**N** - node, **W** - way, **R** - relation)

View File

@@ -9,7 +9,7 @@ the address computation and the search frontend.
The __data import__ stage reads the raw OSM data and extracts all information
that is useful for geocoding. This part is done by osm2pgsql, the same tool
that can also be used to import a rendering database. It uses the special
gazetteer output plugin in `osm2pgsql/src/output-gazetter.[ch]pp`. The result of
flex output style defined in the directory `/lib-lua`. The result of
the import can be found in the database table `place`.
The __address computation__ or __indexing__ stage takes the data from `place`

View File

@@ -37,7 +37,6 @@ def run_osm2pgsql(options: Mapping[str, Any]) -> None:
'--style', str(options['osm2pgsql_style'])
]
if str(options['osm2pgsql_style']).endswith('.lua'):
env['LUA_PATH'] = ';'.join((str(options['osm2pgsql_style_path'] / '?.lua'),
os.environ.get('LUA_PATH', ';')))
env['THEMEPARK_PATH'] = str(options['osm2pgsql_style_path'] / 'themes')
@@ -49,9 +48,6 @@ def run_osm2pgsql(options: Mapping[str, Any]) -> None:
if options['tablespaces'][f"main_{flavour}"]:
env[f"NOMINATIM_TABLESPACE_PLACE_{flavour.upper()}"] = \
options['tablespaces'][f"main_{flavour}"]
else:
cmd.extend(('--output', 'gazetteer', '--hstore', '--latlon'))
cmd.extend(_mk_tablespace_options('main', options))
if options['flatnode_file']:
cmd.extend(('--flat-nodes', options['flatnode_file']))

View File

@@ -26,7 +26,8 @@ fi
return dict(osm2pgsql=str(osm2pgsql_exec),
osm2pgsql_cache=10,
osm2pgsql_style='style.file',
osm2pgsql_style='style.lua',
osm2pgsql_style_path=tmp_path,
threads=1,
dsn='dbname=' + temp_db,
flatnode_file='',

View File

@@ -37,7 +37,7 @@ def test_import_osm_file_simple(dsn, table_factory, osm2pgsql_options, capfd):
captured = capfd.readouterr()
assert '--append' in captured.out
assert '--output gazetteer' in captured.out
assert '--output flex' in captured.out
assert f'--style {osm2pgsql_options["osm2pgsql_style"]}' in captured.out
assert f'--number-processes {osm2pgsql_options["threads"]}' in captured.out
assert f'--cache {osm2pgsql_options["osm2pgsql_cache"]}' in captured.out
@@ -57,7 +57,7 @@ def test_import_osm_object_main_api(dsn, osm2pgsql_options, monkeypatch,
assert get_url_mock.url.startswith(url)
assert '--append' in captured.out
assert '--output gazetteer' in captured.out
assert '--output flex' in captured.out
assert f'--style {osm2pgsql_options["osm2pgsql_style"]}' in captured.out
assert f'--number-processes {osm2pgsql_options["threads"]}' in captured.out
assert f'--cache {osm2pgsql_options["osm2pgsql_cache"]}' in captured.out

View File

@@ -83,7 +83,7 @@ def test_import_osm_data_simple(table_factory, osm2pgsql_options, capfd):
captured = capfd.readouterr()
assert '--create' in captured.out
assert '--output gazetteer' in captured.out
assert '--output flex' in captured.out
assert f'--style {osm2pgsql_options["osm2pgsql_style"]}' in captured.out
assert f'--number-processes {osm2pgsql_options["threads"]}' in captured.out
assert f'--cache {osm2pgsql_options["osm2pgsql_cache"]}' in captured.out