Addresses with housenumber 0 are found

This commit is contained in:
marc tobias
2019-10-30 18:49:02 +01:00
parent 5930383404
commit eeb26aaa6f
3 changed files with 8 additions and 7 deletions

View File

@@ -76,14 +76,14 @@ class AddressDetails
$bFallback = true; $bFallback = true;
} }
$sName = false; $sName = null;
if (isset($aLine['localname']) && $aLine['localname']) { if (isset($aLine['localname']) && $aLine['localname']!=='') {
$sName = $aLine['localname']; $sName = $aLine['localname'];
} elseif (isset($aLine['housenumber']) && $aLine['housenumber']) { } elseif (isset($aLine['housenumber']) && $aLine['housenumber']!=='') {
$sName = $aLine['housenumber']; $sName = $aLine['housenumber'];
} }
if ($sName) { if (isset($sName)) {
$sTypeLabel = strtolower(isset($aTypeLabel['simplelabel']) ? $aTypeLabel['simplelabel'] : $aTypeLabel['label']); $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel']) ? $aTypeLabel['simplelabel'] : $aTypeLabel['label']);
$sTypeLabel = str_replace(' ', '_', $sTypeLabel); $sTypeLabel = str_replace(' ', '_', $sTypeLabel);
if (!isset($aAddress[$sTypeLabel]) if (!isset($aAddress[$sTypeLabel])
@@ -97,6 +97,7 @@ class AddressDetails
} }
} }
} }
return $aAddress; return $aAddress;
} }

View File

@@ -447,8 +447,8 @@ class SearchDescription
$iLimit $iLimit
); );
//now search for housenumber, if housenumber provided // Now search for housenumber, if housenumber provided. Can be zero.
if ($this->sHouseNumber && !empty($aResults)) { if (($this->sHouseNumber || $this->sHouseNumber === '0') && !empty($aResults)) {
// Downgrade the rank of the street results, they are missing // Downgrade the rank of the street results, they are missing
// the housenumber. // the housenumber.
foreach ($aResults as $oRes) { foreach ($aResults as $oRes) {

View File

@@ -64,7 +64,7 @@
$bNotUsed = isset($aAddressLine['isaddress']) && !$aAddressLine['isaddress']; $bNotUsed = isset($aAddressLine['isaddress']) && !$aAddressLine['isaddress'];
echo '<tr class="' . ($bNotUsed?'notused':'') . '">'."\n"; 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>' . $aAddressLine['class'].':'.$aAddressLine['type'] . "</td>\n";
echo ' <td>' . osmLink($aAddressLine) . "</td>\n"; echo ' <td>' . osmLink($aAddressLine) . "</td>\n";
echo ' <td>' . (isset($aAddressLine['rank_address']) ? $aAddressLine['rank_address'] : '') . "</td>\n"; echo ' <td>' . (isset($aAddressLine['rank_address']) ? $aAddressLine['rank_address'] : '') . "</td>\n";