mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-10-27 11:42:46 +03:00
Merge branch 'housenumber-zero' of https://github.com/mtmail/Nominatim into mtmail-housenumber-zero
This commit is contained in:
commit
a4e514033d
@ -76,14 +76,14 @@ class AddressDetails
|
||||
$bFallback = true;
|
||||
}
|
||||
|
||||
$sName = false;
|
||||
if (isset($aLine['localname']) && $aLine['localname']) {
|
||||
$sName = null;
|
||||
if (isset($aLine['localname']) && $aLine['localname']!=='') {
|
||||
$sName = $aLine['localname'];
|
||||
} elseif (isset($aLine['housenumber']) && $aLine['housenumber']) {
|
||||
} elseif (isset($aLine['housenumber']) && $aLine['housenumber']!=='') {
|
||||
$sName = $aLine['housenumber'];
|
||||
}
|
||||
|
||||
if ($sName) {
|
||||
if (isset($sName)) {
|
||||
$sTypeLabel = strtolower(isset($aTypeLabel['simplelabel']) ? $aTypeLabel['simplelabel'] : $aTypeLabel['label']);
|
||||
$sTypeLabel = str_replace(' ', '_', $sTypeLabel);
|
||||
if (!isset($aAddress[$sTypeLabel])
|
||||
@ -97,6 +97,7 @@ class AddressDetails
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aAddress;
|
||||
}
|
||||
|
||||
|
@ -447,8 +447,8 @@ class SearchDescription
|
||||
$iLimit
|
||||
);
|
||||
|
||||
//now search for housenumber, if housenumber provided
|
||||
if ($this->sHouseNumber && !empty($aResults)) {
|
||||
// Now search for housenumber, if housenumber provided. Can be zero.
|
||||
if (($this->sHouseNumber || $this->sHouseNumber === '0') && !empty($aResults)) {
|
||||
// Downgrade the rank of the street results, they are missing
|
||||
// the housenumber.
|
||||
foreach ($aResults as $oRes) {
|
||||
|
@ -64,7 +64,7 @@
|
||||
$bNotUsed = isset($aAddressLine['isaddress']) && !$aAddressLine['isaddress'];
|
||||
|
||||
echo '<tr class="' . ($bNotUsed?'notused':'') . '">'."\n";
|
||||
echo ' <td class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>')."</td>\n";
|
||||
echo ' <td class="name">'.(trim($aAddressLine['localname'])!==null?$aAddressLine['localname']:'<span class="noname">No Name</span>')."</td>\n";
|
||||
echo ' <td>' . $aAddressLine['class'].':'.$aAddressLine['type'] . "</td>\n";
|
||||
echo ' <td>' . osmLink($aAddressLine) . "</td>\n";
|
||||
echo ' <td>' . (isset($aAddressLine['rank_address']) ? $aAddressLine['rank_address'] : '') . "</td>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user