]> git.openstreetmap.org Git - nominatim.git/blob - nominatim/tools/refresh.py
859b5646ea188ec58badc636549dcaa09b9a9fd7
[nominatim.git] / nominatim / tools / refresh.py
1 """
2 Functions for bringing auxiliary data in the database up-to-date.
3 """
4 from ..db.utils import execute_file
5
6 def update_postcodes(conn, datadir):
7     """ Recalculate postcode centroids and add, remove and update entries in the
8         location_postcode table. `conn` is an opne connection to the database.
9     """
10     execute_file(conn, datadir / 'sql' / 'update-postcodes.sql')
11
12
13 def recompute_word_counts(conn, datadir):
14     """ Compute the frequency of full-word search terms.
15     """
16     execute_file(conn, datadir / 'sql' / 'words_from_search_name.sql')