mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
handle 'order state level queries better
This commit is contained in:
@@ -898,7 +898,7 @@
|
|||||||
// More efficient - can make the range bigger
|
// More efficient - can make the range bigger
|
||||||
$fRange = 0.05;
|
$fRange = 0.05;
|
||||||
|
|
||||||
$sSQL = "select l.place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." as l";
|
$sSQL = "select distinct l.place_id 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)";
|
||||||
if ($sPlaceIDs)
|
if ($sPlaceIDs)
|
||||||
{
|
{
|
||||||
@@ -926,7 +926,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isset($aSearch['fRadius']) && $aSearch['fRadius']) $fRange = $aSearch['fRadius'];
|
if (isset($aSearch['fRadius']) && $aSearch['fRadius']) $fRange = $aSearch['fRadius'];
|
||||||
$sSQL = "select l.place_id from placex as l,placex as f where ";
|
$sSQL = "select distinct l.place_id 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) ";
|
||||||
$sSQL .= "and l.class='".$aSearch['sClass']."' and l.type='".$aSearch['sType']."' ";
|
$sSQL .= "and l.class='".$aSearch['sClass']."' and l.type='".$aSearch['sType']."' ";
|
||||||
if (sizeof($aExcludePlaceIDs))
|
if (sizeof($aExcludePlaceIDs))
|
||||||
|
|||||||
Reference in New Issue
Block a user