]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
handle multiple results from gb_postcode table
[nominatim.git] / lib / lib.php
index 54c8c7d0d7176c581b1e92d5b9d89c3e229f928a..e569aa8b53e299a4c2f4d3b618b3525d8200d618 100644 (file)
 
                if (sizeof($aNearPostcodes))
                {
 
                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;
                }
 
                return false;