mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-26 22:44:44 +03:00
5e989b9296
The default location of osm2pgsql and the postgresql module is decided at compile/installation time and is not necessarily in the project directory. With this change it is now possible to have a project directory that is completely separate from the build directory.
33 lines
709 B
PHP
Executable File
33 lines
709 B
PHP
Executable File
<?php
|
|
|
|
function checkInFile($sOSMFile)
|
|
{
|
|
if (!isset($sOSMFile)) {
|
|
fail('missing --osm-file for data import');
|
|
}
|
|
|
|
if (!file_exists($sOSMFile)) {
|
|
fail('the path supplied to --osm-file does not exist');
|
|
}
|
|
|
|
if (!is_readable($sOSMFile)) {
|
|
fail('osm-file "' . $aCMDResult['osm-file'] . '" not readable');
|
|
}
|
|
}
|
|
|
|
function getOsm2pgsqlBinary()
|
|
{
|
|
return getSetting('OSM2PGSQL_BINARY', CONST_Default_Osm2pgsql);
|
|
}
|
|
|
|
function getImportStyle()
|
|
{
|
|
$sStyle = getSetting('IMPORT_STYLE');
|
|
|
|
if (in_array($sStyle, array('admin', 'street', 'address', 'full', 'extratags'))) {
|
|
return CONST_DataDir.'/settings/import-'.$sStyle.'.style';
|
|
}
|
|
|
|
return $sStyle;
|
|
}
|