]> git.openstreetmap.org Git - nominatim.git/commitdiff
don't include linked_place_id places in the sql output (causes errors on paging ...
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 5 Nov 2012 13:57:02 +0000 (13:57 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 5 Nov 2012 13:57:02 +0000 (13:57 +0000)
website/search.php

index 2b6a4c3471fd6b26aeada6c6c1cba58a4bb9789f..93710770e2509793e9c89b4daddefce8ee6d5184 100755 (executable)
@@ -1,4 +1,5 @@
 <?php
+phpinfo();exit;
        require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
 
                                                                {
                                                                $sSQL = "select place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." ct";
                                                                if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
-                                                               $sSQL .= " where st_contains($sViewboxSmallSQL, ct.centroid)";
+                                                               $sSQL .= " where st_contains($sViewboxSmallSQL, ct.centroid) and linked_place_id is null";
                                                                if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, ct.centroid) asc";
                                                                $sSQL .= " limit $iLimit";
                                                                {
                                                                        $sSQL = "select place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." ct";
                                                                        if ($sCountryCodesSQL) $sSQL .= " join placex using (place_id)";
-                                                                       $sSQL .= " where st_contains($sViewboxLargeSQL, ct.centroid)";
+                                                                       $sSQL .= " where st_contains($sViewboxLargeSQL, ct.centroid) and linked_place_id is null";
                                                                        if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                        if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, ct.centroid) asc";
                                                                        $sSQL .= " limit $iLimit";
                                                        else
                                                        {
                                                                $sSQL = "select place_id from placex where class='".$aSearch['sClass']."' and type='".$aSearch['sType']."'";
-                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, geometry)";
+                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, geometry) and linked_place_id is null";
                                                                if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, centroid) asc";
                                                                $sSQL .= " limit $iLimit";
                                                                {
                                                                        // If they were searching for a named class (i.e. 'Kings Head pub') then we might have an extra match
                                                                        $sSQL = "select place_id from placex where place_id in ($sPlaceIDs) and class='".$aSearch['sClass']."' and type='".$aSearch['sType']."'";
+                                                                       $sSQL = " and linked_place_id is null";
                                                                        if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                        $sSQL .= " order by rank_search asc limit $iLimit";
                                                                        if (CONST_Debug) var_dump($sSQL);