From 3257c04d94e70d2cf189e8fe986d3907b822c059 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 8 May 2015 19:48:27 +0200 Subject: [PATCH] make Tiger data path configurable --- settings/settings.php | 1 + utils/imports.php | 5 ++--- utils/setup.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/settings/settings.php b/settings/settings.php index 75b9ac23..1d91b61c 100644 --- a/settings/settings.php +++ b/settings/settings.php @@ -18,6 +18,7 @@ @define('CONST_Path_Postgresql_Postgis', CONST_Path_Postgresql_Contrib.'/postgis-'.CONST_Postgis_Version); @define('CONST_Osm2pgsql_Binary', CONST_BasePath.'/osm2pgsql/osm2pgsql'); @define('CONST_Osmosis_Binary', '/usr/bin/osmosis'); + @define('CONST_Tiger_Data_Path', CONST_BasePath.'/data/tiger'); // osm2pgsql settings @define('CONST_Osm2pgsql_Flatnode_File', null); diff --git a/utils/imports.php b/utils/imports.php index 332e5b31..70a24963 100755 --- a/utils/imports.php +++ b/utils/imports.php @@ -3,7 +3,6 @@ require_once(dirname(dirname(__FILE__)).'/lib/init-cmd.php'); ini_set('memory_limit', '800M'); - $sDefaultDataPath = CONST_BasePath.'/data/tiger2014'; $aCMDOptions = array( "Create and setup nominatim search system", @@ -18,7 +17,7 @@ if (isset($aCMDResult['parse-tiger'])) { - if (!file_exists($sDefaultDataPath)) mkdir($sDefaultDataPath); + if (!file_exists(CONST_Tiger_Data_Path)) mkdir(CONST_Tiger_Data_Path); $sTempDir = tempnam('/tmp', 'tiger'); unlink($sTempDir); @@ -48,7 +47,7 @@ } else { - copy($sOsmFile, $sDefaultDataPath.'/'.$sCountyID.'.sql'); + copy($sOsmFile, CONST_Tiger_Data_Path.'/'.$sCountyID.'.sql'); } } // Cleanup diff --git a/utils/setup.php b/utils/setup.php index 3c038e66..b49813a8 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -484,7 +484,7 @@ $aDBInstances[$i] =& getDB(true); } - foreach(glob(CONST_BasePath.'/data/tiger2014/*.sql') as $sFile) + foreach(glob(CONST_Tiger_Data_Path.'/*.sql') as $sFile) { echo $sFile.': '; $hFile = fopen($sFile, "r"); -- 2.39.5