X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8b1a509442a3fa051146f82b8293126916ad8617..a2edbbf78a9612193d7751806d310de385549dee:/nominatim/tools/database_import.py?ds=sidebyside diff --git a/nominatim/tools/database_import.py b/nominatim/tools/database_import.py index 664d3c6b..efbf2ec8 100644 --- a/nominatim/tools/database_import.py +++ b/nominatim/tools/database_import.py @@ -199,7 +199,7 @@ def load_data(dsn, threads): conn.perform("""INSERT INTO placex ({0}) SELECT {0} FROM place WHERE osm_id % {1} = {2} - AND NOT (class='place' and type='houses') + AND NOT (class='place' and (type='houses' or type='postcode')) AND ST_IsValid(geometry) """.format(_COPY_COLUMNS, place_threads, imod)) sel.register(conn, selectors.EVENT_READ, conn) @@ -272,15 +272,15 @@ def create_country_names(conn, tokenizer, languages=None): with tokenizer.name_analyzer() as analyzer: for code, name in cur: - names = [code] + names = {'countrycode' : code} if code == 'gb': - names.append('UK') + names['short_name'] = 'UK' if code == 'us': - names.append('United States') + names['short_name'] = 'United States' # country names (only in languages as provided) if name: - names.extend((v for k, v in name.items() if _include_key(k))) + names.update(((k, v) for k, v in name.items() if _include_key(k))) analyzer.add_country_names(code, names)