+ foreach ($aDBResults as $aResult) {
+ $oResult = new Result($aResult['place_id']);
+ $oResult->iExactMatches = $aResult['exactmatch'];
+ $oResult->iAddressRank = $aResult['address_rank'];
+
+ $bNeedResult = true;
+ if ($this->hasHousenumber() && $aResult['address_rank'] < 30) {
+ if ($aResult['placex_hnr']) {
+ foreach (explode(',', substr($aResult['placex_hnr'], 1, -1)) as $sPlaceID) {
+ $iPlaceID = intval($sPlaceID);
+ $oHnrResult = new Result($iPlaceID);
+ $oHnrResult->iExactMatches = $aResult['exactmatch'];
+ $oHnrResult->iAddressRank = 30;
+ $aResults[$iPlaceID] = $oHnrResult;
+ $bNeedResult = false;
+ }
+ }
+ if ($aResult['interpol_hnr']) {
+ foreach (explode(',', substr($aResult['interpol_hnr'], 1, -1)) as $sPlaceID) {
+ $iPlaceID = intval($sPlaceID);
+ $oHnrResult = new Result($iPlaceID, Result::TABLE_OSMLINE);
+ $oHnrResult->iExactMatches = $aResult['exactmatch'];
+ $oHnrResult->iAddressRank = 30;
+ $oHnrResult->iHouseNumber = intval($this->sHouseNumber);
+ $aResults[$iPlaceID] = $oHnrResult;
+ $bNeedResult = false;
+ }
+ }
+ if ($aResult['tiger_hnr']) {
+ foreach (explode(',', substr($aResult['tiger_hnr'], 1, -1)) as $sPlaceID) {
+ $iPlaceID = intval($sPlaceID);
+ $oHnrResult = new Result($iPlaceID, Result::TABLE_TIGER);
+ $oHnrResult->iExactMatches = $aResult['exactmatch'];
+ $oHnrResult->iAddressRank = 30;
+ $oHnrResult->iHouseNumber = intval($this->sHouseNumber);
+ $aResults[$iPlaceID] = $oHnrResult;
+ $bNeedResult = false;
+ }
+ }