mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-07 10:34:08 +00:00
copy interpolation data from new place_interpolation table
This commit is contained in:
@@ -8,10 +8,12 @@
|
|||||||
DROP TABLE IF EXISTS location_property_osmline;
|
DROP TABLE IF EXISTS location_property_osmline;
|
||||||
CREATE TABLE location_property_osmline (
|
CREATE TABLE location_property_osmline (
|
||||||
place_id BIGINT NOT NULL,
|
place_id BIGINT NOT NULL,
|
||||||
|
osm_type CHAR(1) NOT NULL,
|
||||||
osm_id BIGINT NOT NULL,
|
osm_id BIGINT NOT NULL,
|
||||||
parent_place_id BIGINT,
|
parent_place_id BIGINT,
|
||||||
geometry_sector INTEGER NOT NULL,
|
geometry_sector INTEGER NOT NULL,
|
||||||
indexed_date TIMESTAMP,
|
indexed_date TIMESTAMP,
|
||||||
|
type TEXT,
|
||||||
startnumber INTEGER,
|
startnumber INTEGER,
|
||||||
endnumber INTEGER,
|
endnumber INTEGER,
|
||||||
step SMALLINT,
|
step SMALLINT,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# 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.
|
# For a full list of authors see the git log.
|
||||||
"""
|
"""
|
||||||
Functions for setting up and importing a new Nominatim database.
|
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})
|
pysql.SQL("""INSERT INTO placex ({columns})
|
||||||
SELECT {columns} FROM place
|
SELECT {columns} FROM place
|
||||||
WHERE osm_id % {total} = {mod}
|
WHERE osm_id % {total} = {mod}
|
||||||
AND NOT (class='place'
|
|
||||||
and (type='houses' or type='postcode'))
|
|
||||||
AND ST_IsValid(geometry)
|
|
||||||
""").format(columns=_COPY_COLUMNS,
|
""").format(columns=_COPY_COLUMNS,
|
||||||
total=pysql.Literal(placex_threads),
|
total=pysql.Literal(placex_threads),
|
||||||
mod=pysql.Literal(imod)), None)
|
mod=pysql.Literal(imod)), None)
|
||||||
|
|
||||||
# Interpolations need to be copied separately
|
# Interpolations need to be copied separately
|
||||||
await pool.put_query("""
|
await pool.put_query("""
|
||||||
INSERT INTO location_property_osmline (osm_id, address, linegeo)
|
INSERT INTO location_property_osmline (osm_type, osm_id, type, address, linegeo)
|
||||||
SELECT osm_id, address, geometry FROM place
|
SELECT osm_type, osm_id, type, address, geometry
|
||||||
WHERE class='place' and type='houses' and osm_type='W'
|
FROM place_interpolation
|
||||||
and ST_GeometryType(geometry) = 'ST_LineString' """, None)
|
""", None)
|
||||||
|
|
||||||
progress.cancel()
|
progress.cancel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user