faster query through bbox preselection

This commit is contained in:
gemo1011 2018-05-03 17:44:18 +02:00
parent 71c9adfdba
commit 424c0d0ebb

View File

@ -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';