From 3f8fcd4055228afeed05dbba7436de5bc011aa64 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 11 Apr 2012 23:39:07 +0200 Subject: [PATCH] add switch for osm2pgsql cache size also increased the default to 15GB to accaommodate growing planet --- utils/setup.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils/setup.php b/utils/setup.php index af0e1a5e..b1c7e5a8 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -18,6 +18,7 @@ array('create-db', '', 0, 1, 0, 0, 'bool', 'Create nominatim db'), array('setup-db', '', 0, 1, 0, 0, 'bool', 'Build a blank nominatim db'), array('import-data', '', 0, 1, 0, 0, 'bool', 'Import a osm file'), + array('osm2pgsql-cache', '', 0, 1, 1, 1, 'int', 'Cache size used by osm2pgsql'), array('create-functions', '', 0, 1, 0, 0, 'bool', 'Create functions'), array('create-minimal-tables', '', 0, 1, 0, 0, 'bool', 'Create minimal main tables'), array('create-tables', '', 0, 1, 0, 0, 'bool', 'Create main tables'), @@ -107,7 +108,17 @@ $osm2pgsql = CONST_Osm2pgsql_Binary; if (!file_exists($osm2pgsql)) fail("please download and build osm2pgsql"); - passthru($osm2pgsql.' -lsc -O gazetteer -C 12000 --hstore -d '.$aDSNInfo['database'].' '.$aCMDResult['osm-file']); + $osm2pgsql .= ' -lsc -O gazetteer --hstore'; + if (isset($aCMDResult['osm2pgsql-cache'])) + { + $osm2pgsql .= ' -C '.$aCMDResult['osm2pgsql-cache']; + } + else + { + $osm2pgsql .= ' -C 15000'; + } + $osm2pgsql .= ' -d '.$aDSNInfo['database'].' '.$aCMDResult['osm-file']; + passthru($osm2pgsql); $oDB =& getDB(); $x = $oDB->getRow('select * from place limit 1');