mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 19:44:07 +00:00
de-deplicate terms
This commit is contained in:
@@ -899,9 +899,9 @@
|
|||||||
$fRange = 0.05;
|
$fRange = 0.05;
|
||||||
|
|
||||||
$sOrderBySQL = '';
|
$sOrderBySQL = '';
|
||||||
if ($sNearPointSQL) $sOrderBySQL .= "ST_Distance($sNearPointSQL, l.centroid)";
|
if ($sNearPointSQL) $sOrderBySQL = "ST_Distance($sNearPointSQL, l.centroid)";
|
||||||
else if ($sPlaceIDs) $sOrderBySQL .= "ST_Distance(l.centroid, f.geometry)";
|
else if ($sPlaceIDs) $sOrderBySQL = "ST_Distance(l.centroid, f.geometry)";
|
||||||
else if ($sPlaceGeom) $sOrderBysSQL .= "ST_Distance(st_centroid('".$sPlaceGeom."'), l.centroid)";
|
else if ($sPlaceGeom) $sOrderBysSQL = "ST_Distance(st_centroid('".$sPlaceGeom."'), l.centroid)";
|
||||||
|
|
||||||
$sSQL = "select distinct l.place_id".($sOrderBysSQL?','.$sOrderBysSQL:'')." from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." as l";
|
$sSQL = "select distinct l.place_id".($sOrderBysSQL?','.$sOrderBysSQL:'')." from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." as l";
|
||||||
if ($sCountryCodesSQL) $sSQL .= " join placex as lp using (place_id)";
|
if ($sCountryCodesSQL) $sSQL .= " join placex as lp using (place_id)";
|
||||||
@@ -931,8 +931,8 @@
|
|||||||
if (isset($aSearch['fRadius']) && $aSearch['fRadius']) $fRange = $aSearch['fRadius'];
|
if (isset($aSearch['fRadius']) && $aSearch['fRadius']) $fRange = $aSearch['fRadius'];
|
||||||
|
|
||||||
$sOrderBySQL = '';
|
$sOrderBySQL = '';
|
||||||
if ($sNearPointSQL) $sOrderBySQL .= "ST_Distance($sNearPointSQL, l.geometry)";
|
if ($sNearPointSQL) $sOrderBySQL = "ST_Distance($sNearPointSQL, l.geometry)";
|
||||||
else $sOrderBySQL .= "ST_Distance(l.geometry, f.geometry)";
|
else $sOrderBySQL = "ST_Distance(l.geometry, f.geometry)";
|
||||||
|
|
||||||
$sSQL = "select distinct l.place_id".($sOrderBysSQL?','.$sOrderBysSQL:'')." from placex as l,placex as f where ";
|
$sSQL = "select distinct l.place_id".($sOrderBysSQL?','.$sOrderBysSQL:'')." from placex as l,placex as f where ";
|
||||||
$sSQL .= "f.place_id in ( $sPlaceIDs) and ST_DWithin(l.geometry, st_centroid(f.geometry), $fRange) ";
|
$sSQL .= "f.place_id in ( $sPlaceIDs) and ST_DWithin(l.geometry, st_centroid(f.geometry), $fRange) ";
|
||||||
|
|||||||
Reference in New Issue
Block a user