From 424c0d0ebb8b76a933d5e255ad7e406310990bb2 Mon Sep 17 00:00:00 2001 From: gemo1011 Date: Thu, 3 May 2018 17:44:18 +0200 Subject: [PATCH] faster query through bbox preselection --- lib/ReverseGeocode.php | 2 ++ 1 file changed, 2 insertions(+) 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'; -- 2.39.5