$this->sViewboxCentreSQL = "ST_SetSRID('LINESTRING(";
$sSep = '';
- foreach ($this->aRoutePoints as $aPoint) {
+ foreach ($aRoutePoints as $aPoint) {
$fPoint = (float)$aPoint;
$this->sViewboxCentreSQL .= $sSep.$fPoint;
$sSep = ($sSep == ' ') ? ',' : ' ';
$aCountries[] = strtolower($sCountryCode);
}
}
- if (isset($aCountryCodes))
+ if (isset($aCountries))
$this->aCountryCodes = $aCountries;
}
&& $aWordFrequencyScores[$aSearch['aName'][reset($aSearch['aName'])]] < CONST_Search_NameOnlySearchFrequencyThreshold
) {
//$aTerms[] = "array_cat(nameaddress_vector,ARRAY[]::integer[]) @> ARRAY[".join(array_merge($aSearch['aAddress'], $aSearch['aAddressNonSearch']), ",")."]";
+ $aTerms[] = "array_cat(nameaddress_vector,ARRAY[]::integer[]) @> ARRAY[".join($aSearch['aAddress'],",")."]";
} else {
$aTerms[] = "nameaddress_vector @> ARRAY[".join($aSearch['aAddress'], ",")."]";
/*if (sizeof($aSearch['aAddressNonSearch'])) {
}
} else {
// Just interpret as a reverse geocode
- $oReverse = new Nominatim\ReverseGeocode($this->oDB);
+ $oReverse = new ReverseGeocode($this->oDB);
$oReverse->setZoom(18);
$aLookup = $oReverse->lookup(
if ($aLookup['place_id']) {
$aSearchResults = $this->getDetails(array($aLookup['place_id'] => -1));
+ $aResultPlaceIDs[$aLookup['place_id']] = -1;
} else {
$aSearchResults = array();
}
// getAddressDetails() is defined in lib.php and uses the SQL function get_addressdata in functions.sql
$aResult['address'] = getAddressDetails($this->oDB, $sLanguagePrefArraySQL, $aResult['place_id'], $aResult['country_code'], $aResultPlaceIDs[$aResult['place_id']]);
if ($aResult['extra_place'] == 'city' && !isset($aResult['address']['city'])) {
- $aResult['address'] = array_merge(array('city' => array_shift(array_values($aResult['address']))), $aResult['address']);
+ $aResult['address'] = array_merge(array('city' => array_values($aResult['address'])[0]), $aResult['address']);
}
}