]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'roques-tetris'
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 22 Apr 2017 16:14:05 +0000 (18:14 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 22 Apr 2017 16:14:05 +0000 (18:14 +0200)
1  2 
utils/setup.php

diff --cc utils/setup.php
index 5ec410000e96a40059dd711cff78f402a5f92cbb,6a809c733f0cf729eb73efd1cecc01acc4687523..6f1ce41d31776bfc03900579eb44ad75a27045dc
@@@ -364,12 -366,8 +366,10 @@@ if ($aCMDResult['load-data'] || $aCMDRe
      $iLoadThreads = max(1, $iInstances - 1);
      for ($i = 0; $i < $iLoadThreads; $i++) {
          $aDBInstances[$i] =& getDB(true);
-         $sSQL = 'insert into placex (osm_type, osm_id, class, type, name, admin_level, ';
-         $sSQL .= '                   address, extratags, geometry) ';
-         $sSQL .= 'select * from place where osm_id % '.$iLoadThreads.' = '.$i;
+         $sSQL = "INSERT INTO placex ($sColumns) SELECT $sColumns FROM place WHERE osm_id % $iLoadThreads = $i";
 -        $sSQL .= " and not (class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString')";
 +        $sSQL .= " and not (class='place' and type='houses' and osm_type='W'";
 +        $sSQL .= "          and ST_GeometryType(geometry) = 'ST_LineString')";
 +        $sSQL .= " and ST_IsValid(geometry)";
          if ($aCMDResult['verbose']) echo "$sSQL\n";
          if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) {
              fail(pg_last_error($aDBInstances[$i]->connection));