]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Feb 2013 22:07:22 +0000 (23:07 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Feb 2013 22:07:22 +0000 (23:07 +0100)
osm2pgsql
sql/functions.sql
utils/update.php

index 5f0cc512e6fe192fc1c4754eed77b142663e38de..3d839831c83b9c9ce04bdd039f102df73beb7d88 160000 (submodule)
--- a/osm2pgsql
+++ b/osm2pgsql
@@ -1 +1 @@
-Subproject commit 5f0cc512e6fe192fc1c4754eed77b142663e38de
+Subproject commit 3d839831c83b9c9ce04bdd039f102df73beb7d88
index 03825f99270f5bb4e7792eaff3a77f3394be85ee..7f8dc07ed758f8f0dcc84423fc2b76817d508259 100644 (file)
@@ -1681,6 +1681,19 @@ BEGIN
 
       IF NEW.centroid IS NOT NULL THEN
         place_centroid := NEW.centroid;
+        -- Place might have had only a name tag before but has now received translations
+        -- from the linked place. Make sure a name tag for the default language exists in
+        -- this case. 
+        IF NEW.name is not null AND array_upper(akeys(NEW.name),1) > 1 THEN
+          default_language := get_country_language_code(NEW.calculated_country_code);
+          IF default_language IS NOT NULL THEN
+            IF NEW.name ? 'name' AND NOT NEW.name ? ('name:'||default_language) THEN
+              NEW.name := NEW.name || hstore(('name:'||default_language), (NEW.name -> 'name'));
+            ELSEIF NEW.name ? ('name:'||default_language) AND NOT NEW.name ? 'name' THEN
+              NEW.name := NEW.name || hstore('name', (NEW.name -> ('name:'||default_language)));
+            END IF;
+          END IF;
+        END IF;
       END IF;
 
       -- Did we gain a wikipedia tag in the process? then we need to recalculate our importance
index 095aaa2ef578fd28a9fd0ec15c19f9f54c7cbbaa..9c50db71dc08f5b0e3e25bfc0188dfb4c074531e 100755 (executable)
                }
                else
                {
-                       $sModifyXMLstr = file_get_contents('http://overpass.osm.rambler.ru/cgi/interpreter?data=node('.$aResult['import-node'].');out%20meta;');
+                       $sModifyXMLstr = file_get_contents('http://overpass-api.de/api/interpreter?data=node('.$aResult['import-node'].');out%20meta;');
                }
        }
        if (isset($aResult['import-way']) && $aResult['import-way'])
                }
                else
                {
-                       $sCmd = 'http://overpass.osm.rambler.ru/cgi/interpreter?data=(way('.$aResult['import-way'].');node(w););out%20meta;';
+                       $sCmd = 'http://overpass-api.de/api/interpreter?data=(way('.$aResult['import-way'].');node(w););out%20meta;';
                }
                $sModifyXMLstr = file_get_contents($sCmd);
        }
                }
                else
                {
-                       $sModifyXMLstr = file_get_contents('http://overpass.osm.rambler.ru/cgi/interpreter?data=((rel('.$aResult['import-relation'].');way(r);node(w));node(r));out%20meta;');
+                       $sModifyXMLstr = file_get_contents('http://overpass-api.de/api/interpreter?data=((rel('.$aResult['import-relation'].');way(r);node(w));node(r));out%20meta;');
                }
        }
        if ($bModifyXML)