mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
remove postcodes entirely from indexing
place=postcode places are artificial places that collect addr:postcode points for aggration. They should neither show up in the address nor be searchable. That means that there is no need to index them at all. Only let boundary=postal_code through which define correct areas for postcodes.
This commit is contained in:
@@ -581,6 +581,15 @@ BEGIN
|
||||
RETURN NEW;
|
||||
END IF;
|
||||
|
||||
-- Postcodes are just here to compute the centroids. They are not searchable
|
||||
-- unless they are a boundary=postal_code.
|
||||
-- There was an error in the style so that boundary=postal_code used to be
|
||||
-- imported as place=postcode. That's why relations are allowed to pass here.
|
||||
-- This can go away in a couple of versions.
|
||||
IF NEW.class = 'place' and NEW.type = 'postcode' and NEW.osm_type != 'R' THEN
|
||||
RETURN NEW;
|
||||
END IF;
|
||||
|
||||
-- Speed up searches - just use the centroid of the feature
|
||||
-- cheaper but less acurate
|
||||
NEW.centroid := ST_PointOnSurface(NEW.geometry);
|
||||
|
||||
@@ -145,10 +145,6 @@ BEGIN
|
||||
THEN
|
||||
SELECT * INTO search_rank, address_rank
|
||||
FROM get_postcode_rank(country, postcode);
|
||||
|
||||
IF NOT extended_type = 'A' THEN
|
||||
address_rank := 0;
|
||||
END IF;
|
||||
ELSEIF extended_type = 'N' AND place_class = 'highway' THEN
|
||||
search_rank = 30;
|
||||
address_rank = 0;
|
||||
|
||||
Reference in New Issue
Block a user