mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 22:04:07 +00:00
Compare commits
2 Commits
f9864b7ec7
...
c05b8f241c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05b8f241c | ||
|
|
da94d7eea3 |
@@ -195,10 +195,10 @@ def create_place_postcode_table(conn: Connection, config: Configuration, **_: An
|
||||
cur.execute(
|
||||
"""
|
||||
CREATE TABLE place_postcode (
|
||||
osm_type VARCHAR(1),
|
||||
osm_id BIGINT,
|
||||
osm_type CHAR(1) NOT NULL,
|
||||
osm_id BIGINT NOT NULL,
|
||||
postcode TEXT NOT NULL,
|
||||
country_code VARCHAR(2),
|
||||
country_code TEXT,
|
||||
centroid GEOMETRY(Point, 4326) NOT NULL,
|
||||
geometry GEOMETRY(Geometry, 4326)
|
||||
)
|
||||
@@ -224,6 +224,11 @@ def create_place_postcode_table(conn: Connection, config: Configuration, **_: An
|
||||
CREATE INDEX place_postcode_osm_id_idx ON place_postcode
|
||||
USING BTREE (osm_type, osm_id)
|
||||
""")
|
||||
cur.execute(
|
||||
"""
|
||||
CREATE INDEX place_postcode_postcode_idx ON place_postcode
|
||||
USING BTREE (postcode)
|
||||
""")
|
||||
cur.execute("ALTER TABLE place ENABLE TRIGGER ALL")
|
||||
if not has_postcode_table:
|
||||
sqlp.run_sql_file(conn, 'functions/postcode_triggers.sql')
|
||||
@@ -343,4 +348,5 @@ def create_place_postcode_table(conn: Connection, config: Configuration, **_: An
|
||||
CREATE INDEX idx_placex_geometry_placenode_nopostcode ON placex
|
||||
USING SPGIST (geometry) {{db.tablespace.address_index}}
|
||||
WHERE osm_type = 'N' and rank_search < 26 and class = 'place';
|
||||
ANALYSE;
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user