]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-sql/functions/place_triggers.sql
update security policy for 4.1 version
[nominatim.git] / lib-sql / functions / place_triggers.sql
index a472d26d898e5b9df70e06014ca55b936e28eb5c..9b968c3e035921995356223f2a04308e0097801b 100644 (file)
@@ -117,16 +117,6 @@ BEGIN
 
   -- ---- All other place types.
 
-  -- Patch in additional country names
-  IF NEW.admin_level = 2 and NEW.type = 'administrative' and NEW.address ? 'country'
-  THEN
-    FOR country IN
-      SELECT name FROM country_name WHERE country_code = lower(NEW.address->'country')
-    LOOP
-      NEW.name = country.name || NEW.name;
-    END LOOP;
-  END IF;
-
   -- When an area is changed from large to small: log and discard change
   IF existing.geometry is not null AND ST_IsValid(existing.geometry)
     AND ST_Area(existing.geometry) > 0.02
@@ -156,6 +146,7 @@ BEGIN
         SELECT DISTINCT osm_id, address, geometry FROM place, planet_osm_ways w
         WHERE NEW.geometry && place.geometry
               and place.osm_type = 'W'
+              and place.address ? 'interpolation'
               and exists (SELECT * FROM location_property_osmline
                           WHERE osm_id = place.osm_id
                                 and indexed_status in (0, 2))