From a115eeeb40fed6eee43ddbb3b7d52009828e8145 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 16 Feb 2026 14:18:39 +0100 Subject: [PATCH] copy interpolation data from new place_interpolation table --- lib-sql/tables/interpolation.sql | 2 ++ src/nominatim_db/tools/database_import.py | 13 +++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib-sql/tables/interpolation.sql b/lib-sql/tables/interpolation.sql index 9a93f8d1..a7b53209 100644 --- a/lib-sql/tables/interpolation.sql +++ b/lib-sql/tables/interpolation.sql @@ -8,10 +8,12 @@ DROP TABLE IF EXISTS location_property_osmline; CREATE TABLE location_property_osmline ( place_id BIGINT NOT NULL, + osm_type CHAR(1) NOT NULL, osm_id BIGINT NOT NULL, parent_place_id BIGINT, geometry_sector INTEGER NOT NULL, indexed_date TIMESTAMP, + type TEXT, startnumber INTEGER, endnumber INTEGER, step SMALLINT, diff --git a/src/nominatim_db/tools/database_import.py b/src/nominatim_db/tools/database_import.py index 9af74bf6..388cca0f 100644 --- a/src/nominatim_db/tools/database_import.py +++ b/src/nominatim_db/tools/database_import.py @@ -2,7 +2,7 @@ # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2025 by the Nominatim developer community. +# Copyright (C) 2026 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for setting up and importing a new Nominatim database. @@ -219,19 +219,16 @@ async def load_data(dsn: str, threads: int) -> None: pysql.SQL("""INSERT INTO placex ({columns}) SELECT {columns} FROM place WHERE osm_id % {total} = {mod} - AND NOT (class='place' - and (type='houses' or type='postcode')) - AND ST_IsValid(geometry) """).format(columns=_COPY_COLUMNS, total=pysql.Literal(placex_threads), mod=pysql.Literal(imod)), None) # Interpolations need to be copied separately await pool.put_query(""" - INSERT INTO location_property_osmline (osm_id, address, linegeo) - SELECT osm_id, address, geometry FROM place - WHERE class='place' and type='houses' and osm_type='W' - and ST_GeometryType(geometry) = 'ST_LineString' """, None) + INSERT INTO location_property_osmline (osm_type, osm_id, type, address, linegeo) + SELECT osm_type, osm_id, type, address, geometry + FROM place_interpolation + """, None) progress.cancel()