X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/54129a6f1590a44ef90e7c7ea6d7600c508f3733..cdd129de702dda5608a07ea81b4ffa8ddaeb477a:/lib/Geocode.php?ds=sidebyside diff --git a/lib/Geocode.php b/lib/Geocode.php index 35c8541a..7eab3678 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -133,6 +133,12 @@ $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop); } + function getViewBoxString() + { + if (!$this->aViewBox) return null; + return $this->aViewBox[0].','.$this->aViewBox[3].','.$this->aViewBox[2].','.$this->aViewBox[1]; + } + function setRoute($aRoutePoints) { $this->aRoutePoints = $aRoutePoints; @@ -291,7 +297,7 @@ $sCountryCodesSQL = false; if ($this->aCountryCodes && sizeof($this->aCountryCodes)) { - $sCountryCodesSQL = join(',', $this->aCountryCodes); + $sCountryCodesSQL = join(',', array_map('addQuotes', $this->aCountryCodes)); } // Hack to make it handle "new york, ny" (and variants) correctly @@ -319,7 +325,7 @@ $sViewboxSmallSQL = "ST_SetSRID(ST_MakeBox2D(ST_Point(".(float)$this->aViewBox[0].",".(float)$this->aViewBox[1]."),ST_Point(".(float)$this->aViewBox[2].",".(float)$this->aViewBox[3].")),4326)"; $sViewboxLargeSQL = "ST_SetSRID(ST_MakeBox2D(ST_Point(".(float)$aBigViewBox[0].",".(float)$aBigViewBox[1]."),ST_Point(".(float)$aBigViewBox[2].",".(float)$aBigViewBox[3].")),4326)"; - $bBoundingBoxSearch = true; + $bBoundingBoxSearch = $this->bBoundedSearch; } // Route SQL @@ -349,7 +355,7 @@ failInternalError("Could not get large viewbox.", $sSQL, $sViewboxLargeSQL); } $sViewboxLargeSQL = "'".$sViewboxLargeSQL."'::geometry"; - $bBoundingBoxSearch = true; + $bBoundingBoxSearch = $this->bBoundedSearch; } // Do we have anything that looks like a lat/lon pair? @@ -971,11 +977,12 @@ if (CONST_Debug) { echo "