From: Sarah Hoffmann Date: Mon, 12 Feb 2018 19:43:39 +0000 (+0100) Subject: ignore empty flatnode file option X-Git-Tag: v3.2.0~127 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/3fda7929294e6c7e59f75854d8ff372e22f0f4d2 ignore empty flatnode file option Fixes #902. --- diff --git a/utils/setup.php b/utils/setup.php index 53778b1c..259ddf2d 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -192,7 +192,7 @@ if ($aCMDResult['import-data'] || $aCMDResult['all']) { fail("osm2pgsql not found in '$osm2pgsql'"); } - if (!is_null(CONST_Osm2pgsql_Flatnode_File)) { + if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) { $osm2pgsql .= ' --flat-nodes '.CONST_Osm2pgsql_Flatnode_File; } if (CONST_Tablespace_Osm2pgsql_Data) @@ -690,7 +690,7 @@ if ($aCMDResult['drop']) { // been deleted already by CASCADE } - if (!is_null(CONST_Osm2pgsql_Flatnode_File)) { + if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) { if ($aCMDResult['verbose']) echo 'deleting '.CONST_Osm2pgsql_Flatnode_File."\n"; unlink(CONST_Osm2pgsql_Flatnode_File); } diff --git a/utils/update.php b/utils/update.php index d643e4bc..cd907d75 100755 --- a/utils/update.php +++ b/utils/update.php @@ -56,7 +56,7 @@ if ($iCacheMemory + 500 > getTotalMemoryMB()) { echo "WARNING: resetting cache memory to $iCacheMemory\n"; } $sOsm2pgsqlCmd = CONST_Osm2pgsql_Binary.' -klas --number-processes 1 -C '.$iCacheMemory.' -O gazetteer -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port']; -if (!is_null(CONST_Osm2pgsql_Flatnode_File)) { +if (!is_null(CONST_Osm2pgsql_Flatnode_File) && CONST_Osm2pgsql_Flatnode_File) { $sOsm2pgsqlCmd .= ' --flat-nodes '.CONST_Osm2pgsql_Flatnode_File; }