+ if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs) && ($iMinAddressRank != 0 || $iMaxAddressRank != 30))
+ {
+ // Need to verify passes rank limits before dropping out of the loop (yuk!)
+ $sSQL = "select place_id from placex where place_id in (".join(',',$aResultPlaceIDs).") ";
+ $sSQL .= "and (placex.rank_address between $iMinAddressRank and $iMaxAddressRank ";
+ if (14 >= $iMinAddressRank && 14 <= $iMaxAddressRank) $sSQL .= " OR (extratags->'place') = 'city'";
+ if ($aAddressRankList) $sSQL .= " OR placex.rank_address in (".join(',',$aAddressRankList).")";
+ $sSQL .= ") ";
+ if (CONST_Debug) var_dump($sSQL);
+ $aResultPlaceIDs = $oDB->getCol($sSQL);
+ }
+
+