From: Sarah Hoffmann Date: Sat, 22 Apr 2017 16:14:05 +0000 (+0200) Subject: Merge branch 'roques-tetris' X-Git-Tag: v3.0.0~36 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/86d5209118bdbacaac817b8f8a6ab7a6c769bdc7 Merge branch 'roques-tetris' --- 86d5209118bdbacaac817b8f8a6ab7a6c769bdc7 diff --cc utils/setup.php index 5ec41000,6a809c73..6f1ce41d --- a/utils/setup.php +++ b/utils/setup.php @@@ -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));