]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/tools/tiger_data.py
add type annotations for database import functions
[nominatim.git] / nominatim / tools / tiger_data.py
index 6e37df5e9df7d2b6b3228c4ba79b8a5350865386..e78dcd8f3ade0695eec2f1842f21f40f3eca80ad 100644 (file)
@@ -13,11 +13,13 @@ import logging
 import os
 import tarfile
 
+from psycopg2.extras import Json
+
 from nominatim.db.connection import connect
 from nominatim.db.async_connection import WorkerPool
 from nominatim.db.sql_preprocessor import SQLPreprocessor
 from nominatim.errors import UsageError
-from nominatim.indexer.place_info import PlaceInfo
+from nominatim.data.place_info import PlaceInfo
 
 LOG = logging.getLogger()
 
@@ -87,7 +89,7 @@ def handle_threaded_sql_statements(pool, fd, analyzer):
             address = dict(street=row['street'], postcode=row['postcode'])
             args = ('SRID=4326;' + row['geometry'],
                     int(row['from']), int(row['to']), row['interpolation'],
-                    PlaceInfo({'address': address}).analyze(analyzer),
+                    Json(analyzer.process_place(PlaceInfo({'address': address}))),
                     analyzer.normalize_postcode(row['postcode']))
         except ValueError:
             continue