]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge branch 'roques-tetris'
[nominatim.git] / utils / setup.php
index 6a809c733f0cf729eb73efd1cecc01acc4687523..6f1ce41d31776bfc03900579eb44ad75a27045dc 100755 (executable)
@@ -367,7 +367,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
     for ($i = 0; $i < $iLoadThreads; $i++) {
         $aDBInstances[$i] =& getDB(true);
         $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));