+ if (4 >= $iMinAddressRank && 4 <= $iMaxAddressRank)
+ {
+ $sSQL = "select place_id from placex where country_code='".$aSearch['sCountryCode']."' and rank_search = 4 order by st_area(geometry) desc limit 1";
+ $aPlaceIDs = $oDB->getCol($sSQL);
+ }
+ }
+ else
+ {
+ if (!$bBoundingBoxSearch && !$aSearch['fLon']) continue;
+ if (!$aSearch['sClass']) continue;
+ if (CONST_Debug) var_dump('<hr>',$aSearch);
+ if (CONST_Debug) _debugDumpGroupedSearches(array($iGroupedRank => array($aSearch)), $aValidTokens);
+
+ $sSQL = "select count(*) from pg_tables where tablename = 'place_classtype_".$aSearch['sClass']."_".$aSearch['sType']."'";
+ if ($oDB->getOne($sSQL))
+ {