mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-25 18:48:15 +00:00
respect exclude_place_ids in poi searches
This commit is contained in:
@@ -831,12 +831,19 @@
|
|||||||
if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
|
if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
|
||||||
$sSQL .= " where st_contains($sViewboxSmallSQL, ct.centroid)";
|
$sSQL .= " where st_contains($sViewboxSmallSQL, ct.centroid)";
|
||||||
if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";
|
if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";
|
||||||
|
if (sizeof($aExcludePlaceIDs))
|
||||||
|
{
|
||||||
|
$sSQL .= " and place_id not in (".join(',',$aExcludePlaceIDs).")";
|
||||||
|
}
|
||||||
if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, ct.centroid) asc";
|
if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, ct.centroid) asc";
|
||||||
$sSQL .= " limit $iLimit";
|
$sSQL .= " limit $iLimit";
|
||||||
if (CONST_Debug) var_dump($sSQL);
|
if (CONST_Debug) var_dump($sSQL);
|
||||||
$aPlaceIDs = $oDB->getCol($sSQL);
|
$aPlaceIDs = $oDB->getCol($sSQL);
|
||||||
|
|
||||||
if (!sizeof($aPlaceIDs))
|
// If excluded place IDs are given, it is fair to assume that
|
||||||
|
// there have been results in the small box, so no further
|
||||||
|
// expansion in that case.
|
||||||
|
if (!sizeof($aPlaceIDs) && !sizeof($aExcludePlaceIDs))
|
||||||
{
|
{
|
||||||
$sSQL = "select place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." ct";
|
$sSQL = "select place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." ct";
|
||||||
if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
|
if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
|
||||||
|
|||||||
Reference in New Issue
Block a user