]> git.openstreetmap.org Git - nominatim.git/commitdiff
handle multiple results from gb_postcode table
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 24 Oct 2013 19:38:07 +0000 (21:38 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 10 Apr 2014 19:50:44 +0000 (21:50 +0200)
lib/lib.php

index 6fdc45a052c704714f3f399b4458e8822a20c50b..268c75581f4292940fcc914ea0855d7849d0e68d 100644 (file)
 
                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;