From: Sarah Hoffmann Date: Wed, 15 Jun 2016 20:39:21 +0000 (+0200) Subject: allow coordinates in query only with name or classtype X-Git-Tag: v3.0.0~155 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/665de339e5c1afde21d836ce4be9abe94ae483e0?hp=--cc 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 --- 665de339e5c1afde21d836ce4be9abe94ae483e0 diff --git a/lib/Geocode.php b/lib/Geocode.php index 876a40b5..a01abbc5 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1307,6 +1307,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();