]> 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:41:48 +0000 (22:41 +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 876a40b585692e9017f9cba2762d87ec97287575..a01abbc564dd26a869eb57cdf212c1f64f62c16a 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();