X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/ff2a40b109f7431c810610c2c350881d07e358e4..9e35e5c2b02887e361972ffbb20e65bbba0d02c7:/lib/SearchContext.php diff --git a/lib/SearchContext.php b/lib/SearchContext.php index b0ff38d8..84159b83 100644 --- a/lib/SearchContext.php +++ b/lib/SearchContext.php @@ -108,8 +108,8 @@ class SearchContext $aViewBox[3] ); - $fHeight = $aViewBox[0] - $aViewBox[2]; - $fWidth = $aViewBox[1] - $aViewBox[3]; + $fHeight = abs($aViewBox[0] - $aViewBox[2]); + $fWidth = abs($aViewBox[1] - $aViewBox[3]); $this->sqlViewboxLarge = sprintf( 'ST_SetSRID(ST_MakeBox2D(ST_Point(%F,%F),ST_Point(%F,%F)),4326)', @@ -267,4 +267,18 @@ class SearchContext return ''; } + + public function debugInfo() + { + return array( + 'Near radius' => $this->fNearRadius, + 'Near point (SQL)' => $this->sqlNear, + 'Bounded viewbox' => $this->bViewboxBounded, + 'Viewbox (SQL, small)' => $this->sqlViewboxSmall, + 'Viewbox (SQL, large)' => $this->sqlViewboxLarge, + 'Viewbox (SQL, centre)' => $this->sqlViewboxCentre, + 'Countries (SQL)' => $this->sqlCountryList, + 'Excluded IDs (SQL)' => $this->sqlExcludeList + ); + } }