2018-08-31 22:31:38 +03:00
|
|
|
<?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');
|
|
|
|
}
|
|
|
|
}
|
2020-12-15 17:37:31 +03:00
|
|
|
|
|
|
|
function getOsm2pgsqlBinary()
|
|
|
|
{
|
2021-01-04 13:37:56 +03:00
|
|
|
return getSetting('OSM2PGSQL_BINARY', CONST_Default_Osm2pgsql);
|
2020-12-15 17:37:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|