From: Brian Quinion Date: Mon, 23 May 2011 16:12:54 +0000 (+0000) Subject: handle 'order state level queries better X-Git-Tag: v2.0.0~138 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/535c3d60d1cd45a03358d54b91af39c23b90bb39 handle 'order state level queries better --- diff --git a/website/search.php b/website/search.php index 6b492414..fc03a58d 100755 --- a/website/search.php +++ b/website/search.php @@ -917,6 +917,8 @@ if ($sCountryCodesSQL) $sSQL .= " and lp.country_code in ($sCountryCodesSQL)"; if ($sNearPointSQL) $sSQL .= " order by ST_Distance($sNearPointSQL, l.centroid) ASC"; else if ($sPlaceIDs) $sSQL .= " order by ST_Distance(l.centroid, f.geometry) asc"; + else if ($sPlaceGeom) $sSQL .= " order by ST_Distance(st_centroid('".$sPlaceGeom."'), l.centroid) asc"; + $sSQL .= " limit $iLimit"; if (CONST_Debug) var_dump($sSQL); $aPlaceIDs = $oDB->getCol($sSQL);