mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
huge cleanup of tigerAddressImport.py
This commit is contained in:
committed by
Sarah Hoffmann
parent
d42aa08705
commit
b062e7e774
@@ -28,20 +28,22 @@ if (isset($aCMDResult['parse-tiger'])) {
|
||||
set_time_limit(30);
|
||||
preg_match('#([0-9]{5})_(.*)#', basename($sImportFile), $aMatch);
|
||||
$sCountyID = $aMatch[1];
|
||||
|
||||
echo "Processing ".$sCountyID."...\n";
|
||||
$sUnzipCmd = "unzip -d $sTempDir $sImportFile";
|
||||
exec($sUnzipCmd);
|
||||
$sShapeFile = $sTempDir.'/'.basename($sImportFile, '.zip').'.shp';
|
||||
if (!file_exists($sShapeFile)) {
|
||||
|
||||
$sShapeFilename = $sTempDir.'/'.basename($sImportFile, '.zip').'.shp';
|
||||
$sSqlFilename = CONST_Tiger_Data_Path.'/'.$sCountyID.'.sql')
|
||||
|
||||
if (!file_exists($sShapeFilename)) {
|
||||
echo "Failed unzip ($sImportFile)\n";
|
||||
} else {
|
||||
$sParseCmd = CONST_BasePath.'/utils/tigerAddressImport.py '.$sShapeFile;
|
||||
$sParseCmd = CONST_BasePath.'/utils/tigerAddressImport.py '.$sShapeFilename.' '.$sSqlFilename;
|
||||
exec($sParseCmd);
|
||||
$sOsmFile = $sTempDir.'/'.basename($sImportFile, '.zip').'.osm1.osm';
|
||||
if (!file_exists($sOsmFile)) {
|
||||
echo "Failed parse ($sImportFile)\n";
|
||||
} else {
|
||||
copy($sOsmFile, CONST_Tiger_Data_Path.'/'.$sCountyID.'.sql');
|
||||
if file_exists($sSqlFilename) unlink($sSqlFilename);
|
||||
}
|
||||
}
|
||||
// Cleanup
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
3300
utils/tiger_county_fips.json
Normal file
3300
utils/tiger_county_fips.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user