]> git.openstreetmap.org Git - nominatim.git/commitdiff
use _st_intersects when dealing with countries, it does not use index
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 28 Jan 2015 20:40:08 +0000 (21:40 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 28 Jan 2015 20:40:08 +0000 (21:40 +0100)
lib/Geocode.php

index 6632cefb841dbbc39c3693256687ceca0aa88ecb..22ad43327adcfd7cf3851257886cd9c1e226d118 100644 (file)
                                                                        $sSQL = "select place_id from placex where calculated_country_code='".$aSearch['sCountryCode']."' and rank_search = 4";
                                                                        if ($sCountryCodesSQL) $sSQL .= " and calculated_country_code in ($sCountryCodesSQL)";
                                     if ($bBoundingBoxSearch)
-                                        $sSQL .= " and st_overlaps($this->sViewboxSmallSQL, geometry)";
+                                        $sSQL .= " and _st_intersects($this->sViewboxSmallSQL, geometry)";
                                                                        $sSQL .= " order by st_area(geometry) desc limit 1";
                                                                        if (CONST_Debug) var_dump($sSQL);
                                                                        $aPlaceIDs = $this->oDB->getCol($sSQL);