From: Sarah Hoffmann Date: Thu, 24 Oct 2013 19:38:07 +0000 (+0200) Subject: handle multiple results from gb_postcode table X-Git-Tag: v2.3.0~60 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/346da9bc0d61ad1d418a95ec351e3d33cf5b152d handle multiple results from gb_postcode table --- diff --git a/lib/lib.php b/lib/lib.php index 6fdc45a0..268c7558 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -254,7 +254,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;