]> 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, 24 Oct 2013 19:38:07 +0000 (21:38 +0200)
lib/lib.php

index 54c8c7d0d7176c581b1e92d5b9d89c3e229f928a..e569aa8b53e299a4c2f4d3b618b3525d8200d618 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;