From: Sarah Hoffmann Date: Thu, 24 Oct 2013 19:38:07 +0000 (+0200) Subject: handle multiple results from gb_postcode table X-Git-Tag: deploy~566 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/b944e8b1720552f02bea3363225e9625f099911f handle multiple results from gb_postcode table --- diff --git a/lib/lib.php b/lib/lib.php index 54c8c7d0..e569aa8b 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;