mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
add command for recomputing importance
This commit is contained in:
@@ -42,6 +42,7 @@ $aCMDOptions
|
||||
array('deduplicate', '', 0, 1, 0, 0, 'bool', 'Deduplicate tokens'),
|
||||
array('recompute-word-counts', '', 0, 1, 0, 0, 'bool', 'Compute frequency of full-word search terms'),
|
||||
array('update-address-levels', '', 0, 1, 0, 0, 'bool', 'Reimport address level configuration (EXPERT)'),
|
||||
array('recompute-importance', '', 0, 1, 0, 0, 'bool', 'Recompute place importances'),
|
||||
array('no-npi', '', 0, 1, 0, 0, 'bool', '(obsolete)'),
|
||||
);
|
||||
|
||||
@@ -320,6 +321,17 @@ if ($aResult['update-address-levels']) {
|
||||
$oAlParser->createTable($oDB, 'address_levels');
|
||||
}
|
||||
|
||||
if ($aResult['recompute-importance']) {
|
||||
echo 'Updating importance values for database.\n';
|
||||
$oDB = new Nominatim\DB();
|
||||
$oDB->connect();
|
||||
|
||||
$sSQL = 'ALTER TABLE placex DISABLE TRIGGER ALL;';
|
||||
$sSQL .= 'UPDATE placex SET (wikipedia, importance) = (SELECT wikipedia, importance FROM compute_importance(extratags, country_code, osm_type, osm_id));';
|
||||
$sSQL .= 'ALTER TABLE placex ENABLE TRIGGER ALL;';
|
||||
$oDB->exec($sSQL);
|
||||
}
|
||||
|
||||
if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) {
|
||||
//
|
||||
if (strpos(CONST_Replication_Url, 'download.geofabrik.de') !== false && CONST_Replication_Update_Interval < 86400) {
|
||||
|
||||
Reference in New Issue
Block a user