]> git.openstreetmap.org Git - nominatim.git/blobdiff - settings/flex-base.lua
Merge pull request #2881 from lonvia/more-update-tests-for-osm2pgsql
[nominatim.git] / settings / flex-base.lua
index d9462588479d5da2b23dcbd936d746b9eb6c432f..19f4e27bde554dd8e01cd2df2932cec7940a58e0 100644 (file)
@@ -331,8 +331,10 @@ function process_tags(o)
     end
 
     -- address keys
-    o:grab_address{match=function (k, v) return COUNTRY_TAGS(k, v) and #v == 2 end,
-                   out_key='country'}
+    o:grab_address{match=COUNTRY_TAGS, out_key='country'}
+    if o.address.country ~= nil and #o.address.country ~= 2 then
+        o.address['country'] = nil
+    end
     if o:grab_name{match=HOUSENAME_TAGS} > 0 then
         fallback = {'place', 'house'}
     end