]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
allow coordinates in query only with name or classtype
[nominatim.git] / lib / Geocode.php
index 48055ec6780cbfe708a843e33070fc7ed869c22d..5c99919c46a940cb3c810343fa11e6389736bceb 100644 (file)
                                                                }
                                                        }
                                                }
+                                               // If a coordinate is given, the search must either
+                                               // be for a name or a special search. Ignore everythin else.
+                                               else if ($aSearch['fLon'] && !sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress']) && !$aSearch['sClass'])
+                                               {
+                                                       $aPlaceIDs = array();
+                                               }
                                                else
                                                {
                                                        $aPlaceIDs = array();
                                $oPlaceLookup->setPolygonSimplificationThreshold($this->fPolygonSimplificationThreshold);
 
                                $aOutlineResult = $oPlaceLookup->getOutlines($aResult['place_id'], $aResult['lon'], $aResult['lat'], $fDiameter/2);
-                               $aResult = array_merge($aResult, $aOutlineResult);
-
+                               if ($aOutlineResult)
+                               {
+                                       $aResult = array_merge($aResult, $aOutlineResult);
+                               }
+                               
                                if ($aResult['extra_place'] == 'city')
                                {
                                        $aResult['class'] = 'place';