X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/09bde0baf96af07d5873e952f604fe4e2409e455..f822b04dbe7caf9794b4f206fd8b75ad0ceafd15:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index 54c8c7d0..482e9598 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -246,7 +246,13 @@ if (sizeof($aNearPostcodes)) { - return array(array('lat' => $aNearPostcodes[0]['lat'], 'lon' => $aNearPostcodes[0]['lon'], 'radius' => 0.005)); + $aPostcodes = array(); + foreach($aNearPostcodes as $aPostcode) + { + $aPostcodes[] = array('lat' => $aPostcode['lat'], 'lon' => $aPostcode['lon'], 'radius' => 0.005); + } + + return $aPostcodes; } return false; @@ -846,12 +852,12 @@ $sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1'; //var_dump($sSQL); $aPlace = $oDB->getRow($sSQL); - $iPlaceID = $aPlace['place_id']; - if (PEAR::IsError($iPlaceID)) + if (PEAR::IsError($aPlace)) { - var_Dump($sSQL, $iPlaceID); + var_Dump($sSQL, $aPlace); exit; } + $iPlaceID = $aPlace['place_id']; } // The point we found might be too small - use the address to find what it is a child of