From 1ba3dbeac4c9cb7514ec07b11540960e0a1ccbc0 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 15 Jun 2016 22:39:21 +0200 Subject: [PATCH] allow coordinates in query only with name or classtype 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Geocode.php b/lib/Geocode.php index 5efb2422..5c99919c 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1271,6 +1271,12 @@ } } } + // 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(); -- 2.39.5