3 Search requests can yield multiple results which match equally well with
4 the original query. In such case Nominatim needs to order the results
5 according to a different criterion: importance. This is a measure for how
6 likely it is that a user will search for a given place. This section explains
7 the sources Nominatim uses for computing importance of a place and how to
10 ### How importance is computed
12 The main value for importance is derived from page ranking values for Wikipedia
13 pages for a place. For places that do not have their own
14 Wikipedia page, a formula is used that derives a static importance from the
15 place's [search rank](../customize/Ranking.md#search-rank).
17 In a second step, a secondary importance value is added which is meant to
18 represent how well-known the general area is where the place is located. It
19 functions as a tie-breaker between places with very similar primary
22 nominatim.org has preprocessed importance tables for the
23 [primary Wikipedia rankings](https://nominatim.org/data/wikimedia-importance.sql.gz)
24 and for [secondary importance](https://nominatim.org/data/wikimedia-secondary-importance.sql.gz)
25 based on Wikipedia importance of the administrative areas.
27 The source code for creating these files is available in the Github projects
28 [osm-search/wikipedia-wikidata](https://github.com/osm-search/wikipedia-wikidata)
30 [osm-search/secondary-importance](https://github.com/osm-search/secondary-importance).
32 ### Customizing secondary importance
34 The secondary importance is implemented as a simple
35 [Postgis raster](https://postgis.net/docs/raster.html) table, where Nominatim
36 looks up the value for the coordinates of the centroid of a place. You can
37 provide your own secondary importance raster in form of an SQL file named
38 `secondary_importance.sql.gz` in your project directory.
40 The SQL file needs to drop and (re)create a table `secondary_importance` which
41 must as a minimum contain a column `rast` of type `raster`. The raster must
42 be in EPSG:4326 and contain 16bit unsigned ints
43 (`raster_constraint_pixel_types(rast) = '{16BUI}'). Any other columns in the
44 table will be ignored. You must furthermore create an index as follows:
47 CREATE INDEX ON secondary_importance USING gist(ST_ConvexHull(gist))
50 The following raster2pgsql command will create a table from a tiff file
51 that conforms to the requirements:
54 raster2pgsql -I -C -Y -d -t 128x128 input.tiff public.secondary_importance