]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 16 Dec 2012 15:25:58 +0000 (16:25 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 16 Dec 2012 15:25:58 +0000 (16:25 +0100)
nominatim/index.c
sql/functions.sql
utils/setup.php

index f337a9ece5d8560cedc9399de8543f0a8e3e9a07..13f292737082f5a4185c45086b6ff90d265c91eb 100644 (file)
@@ -308,6 +308,13 @@ void nominatim_index(int rank_min, int rank_max, int num_threads, const char *co
     {
         nominatim_exportXMLEnd(writer);
     }
+
+    // Close all connections
+    for (i = 0; i < num_threads; i++)
+    {
+        PQfinish(thread_data[i].conn);
+    }
+    PQfinish(conn);
 }
 
 void *nominatim_indexThread(void * thread_data_in)
index aa2a8908a1f24a664681524d8094b4c5d0a570a5..dfb6463478d6ada2f9e2d9699b8bd378b1da8400 100644 (file)
@@ -1209,7 +1209,13 @@ BEGIN
     END IF;
     IF diameter > 0 THEN
 --      RAISE WARNING 'placex point insert: % % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type,diameter;
-      update placex set indexed_status = 2 where indexed_status = 0 and rank_search > NEW.rank_search and ST_DWithin(placex.geometry, NEW.geometry, diameter) and (rank_search < 28 or name is not null);
+      IF NEW.rank_search >= 26 THEN
+        -- roads may cause reparenting for >27 rank places
+        update placex set indexed_status = 2 where indexed_status = 0 and rank_search > NEW.rank_search and ST_DWithin(placex.geometry, NEW.geometry, diameter);
+      ELSE
+        -- for all other places the search terms may change as well
+        update placex set indexed_status = 2 where indexed_status = 0 and rank_search > NEW.rank_search and ST_DWithin(placex.geometry, NEW.geometry, diameter) and (rank_search < 28 or name is not null);
+      END IF;
     END IF;
 
   END IF;
index d402b5543ec86d0095a805b67a0bb32dff6acda5..33de5d85ec0f97d6ab0ad9b0c9a08e54a3ec8c58 100755 (executable)
@@ -95,7 +95,7 @@
                {
                        fail('database already exists ('.CONST_Database_DSN.')');
                }
-               passthru('createdb -E UTF-8 '.$aDSNInfo['database']);
+               passthruCheckReturn('createdb -E UTF-8 '.$aDSNInfo['database']);
        }
 
        if ($aCMDResult['setup-db'] || $aCMDResult['all'])