From: gemo1011 Date: Thu, 3 May 2018 15:44:18 +0000 (+0200) Subject: faster query through bbox preselection X-Git-Tag: v3.2.0~60^2~27 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/424c0d0ebb8b76a933d5e255ad7e406310990bb2 faster query through bbox preselection --- diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index f720eea3..9576fafc 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -103,6 +103,8 @@ class ReverseGeocode $sSQL .= ' AND type != \'postcode\''; $sSQL .= ' AND name IS NOT NULL '; $sSQL .= ' and class not in (\'waterway\',\'railway\',\'tunnel\',\'bridge\',\'man_made\')'; + // preselection through bbox + $sSQL .= ' AND (SELECT geometry FROM placex WHERE place_id = '.$iPlaceID.') && geometry'; $sSQL .= ' ORDER BY distance ASC,'; $sSQL .= ' rank_address DESC'; $sSQL .= ' limit 500) as a';