From 291a161cc68c6226bcacc5e3e7a541ddc6553e2b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 22 Apr 2017 10:34:03 +0200 Subject: [PATCH] make sure no invalid geometries end up in placex --- utils/setup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/setup.php b/utils/setup.php index fae200cc..5ec41000 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -367,7 +367,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { $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 .= " 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)); -- 2.39.5