]> git.openstreetmap.org Git - nominatim.git/commitdiff
allow coordinates in query only with name or classtype
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 15 Jun 2016 20:39:21 +0000 (22:39 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 15 Jun 2016 20:43:53 +0000 (22:43 +0200)
Coordinates with country or housenumber only do not make much
sense. Currently these combination result in queries that
require a sequential scan of search_name and normally time
out before yielding any results.

fixes #462

lib/Geocode.php

index 5efb2422c484e01a865f30f7c9776909b3b57d25..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();