X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cd3ddec7463359524c3df2c66cb784746661afdc..c6a7ef5574179af010deddef033f4001dd7d4c40:/lib/setup/SetupClass.php diff --git a/lib/setup/SetupClass.php b/lib/setup/SetupClass.php index 1c4547e3..12a1bb0d 100755 --- a/lib/setup/SetupClass.php +++ b/lib/setup/SetupClass.php @@ -29,10 +29,13 @@ class SetupFunctions warn('resetting threads to '.$this->iInstances); } - // Assume we can steal all the cache memory in the box (unless told otherwise) if (isset($aCMDResult['osm2pgsql-cache'])) { $this->iCacheMemory = $aCMDResult['osm2pgsql-cache']; + } elseif (!is_null(CONST_Osm2pgsql_Flatnode_File)) { + // When flatnode files are enabled then disable cache per default. + $this->iCacheMemory = 0; } else { + // Otherwise: Assume we can steal all the cache memory in the box. $this->iCacheMemory = getCacheMemoryMB(); } @@ -160,13 +163,6 @@ class SetupFunctions if ($this->bNoPartitions) { $this->pgsqlRunScript('update country_name set partition = 0'); } - - // the following will be needed by createFunctions later but - // is only defined in the subsequently called createTables - // Create dummies here that will be overwritten by the proper - // versions in create-tables. - $this->pgsqlRunScript('CREATE TABLE IF NOT EXISTS place_boundingbox ()'); - $this->pgsqlRunScript('CREATE TYPE wikipedia_article_match AS ()', false); } public function importData($sOSMFile) @@ -323,11 +319,11 @@ class SetupFunctions public function importWikipediaArticles() { - $this->pgExec('DROP TABLE wikipedia_article'); - $this->pgExec('DROP TABLE wikipedia_redirect'); $sWikiArticlesFile = CONST_Wikipedia_Data_Path.'/wikimedia-importance.sql.gz'; if (file_exists($sWikiArticlesFile)) { info('Importing wikipedia articles and redirects'); + $this->pgExec('DROP TABLE IF EXISTS wikipedia_article'); + $this->pgExec('DROP TABLE IF EXISTS wikipedia_redirect'); $this->pgsqlRunScriptFile($sWikiArticlesFile); } else { warn('wikipedia importance dump file not found - places will have default importance'); @@ -346,8 +342,6 @@ class SetupFunctions echo '.'; $this->pgExec('TRUNCATE place_addressline'); echo '.'; - $this->pgExec('TRUNCATE place_boundingbox'); - echo '.'; $this->pgExec('TRUNCATE location_area'); echo '.'; if (!$this->dbReverseOnly()) {