]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove unused functions in Geocode
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 26 Jul 2016 21:01:42 +0000 (23:01 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 26 Jul 2016 21:10:50 +0000 (23:10 +0200)
lib/Geocode.php
website/search.php

index 3d1e82d33d6ff3084215420223bc0e6b92e3d921..9249b31474ef6900455ef697f3b9a5862be216ec 100644 (file)
                        $this->aLangPrefOrder = $aLangPref;
                }
 
-               function setIncludeAddressDetails($bAddressDetails = true)
-               {
-                       $this->bIncludeAddressDetails = (bool)$bAddressDetails;
-               }
-
                function getIncludeAddressDetails()
                {
                        return $this->bIncludeAddressDetails;
                        $this->bIncludePolygonAsPoints = $b;
                }
 
-               function getIncludePolygonAsPoints()
-               {
-                       return $this->bIncludePolygonAsPoints;
-               }
-
                function setIncludePolygonAsText($b = true)
                {
                        $this->bIncludePolygonAsText = $b;
                }
 
-               function getIncludePolygonAsText()
-               {
-                       return $this->bIncludePolygonAsText;
-               }
-
                function setIncludePolygonAsGeoJSON($b = true)
                {
                        $this->bIncludePolygonAsGeoJSON = $b;
                        $this->fPolygonSimplificationThreshold = $f;
                }
 
-               function setDeDupe($bDeDupe = true)
-               {
-                       $this->bDeDupe = (bool)$bDeDupe;
-               }
-
                function setLimit($iLimit = 10)
                {
                        if ($iLimit > 50) $iLimit = 50;
                        $this->iLimit = $this->iFinalLimit + min($this->iFinalLimit, 10);
                }
 
-               function setOffset($iOffset = 0)
-               {
-                       $this->iOffset = $iOffset;
-               }
-
-               function setFallback($bFallback = true)
-               {
-                       $this->bFallback = (bool)$bFallback;
-               }
-
-               function setExcludedPlaceIDs($a)
-               {
-                       // TODO: force to int
-                       $this->aExcludePlaceIDs = $a;
-               }
-
                function getExcludedPlaceIDs()
                {
                        return $this->aExcludePlaceIDs;
                }
 
-               function setBounded($bBoundedSearch = true)
-               {
-                       $this->bBoundedSearch = (bool)$bBoundedSearch;
-               }
-
                function setViewBox($fLeft, $fBottom, $fRight, $fTop)
                {
                        $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop);
                        return $this->aViewBox[0].','.$this->aViewBox[3].','.$this->aViewBox[2].','.$this->aViewBox[1];
                }
 
-               function setRoute($aRoutePoints)
-               {
-                       $this->aRoutePoints = $aRoutePoints;
-               }
-
                function setFeatureType($sFeatureType)
                {
                        switch($sFeatureType)
 
                function setRankRange($iMin, $iMax)
                {
-                       $this->iMinAddressRank = (int)$iMin;
-                       $this->iMaxAddressRank = (int)$iMax;
+                       $this->iMinAddressRank = $iMin;
+                       $this->iMaxAddressRank = $iMax;
                }
 
                function setNearPoint($aNearPoint, $fRadiusDeg = 0.1)
                        $this->aNearPoint = array((float)$aNearPoint[0], (float)$aNearPoint[1], (float)$fRadiusDeg);
                }
 
-               function setCountryCodesList($aCountryCodes)
-               {
-                       $this->aCountryCodes = $aCountryCodes;
-               }
-
                function setQuery($sQueryString)
                {
                        $this->sQuery = $sQueryString;
index 4baf3ef5572b9b9fc288b7e7485aa3778eb1f30c..4c283d1aa40827798334aa99f30a34b5d9e65643 100755 (executable)
@@ -32,6 +32,7 @@
        if ($sOutputFormat == 'html')
        {
                $oGeocode->setIncludePolygonAsText(getParamBool('polygon'));
+               $bAsText = false;
        }
        else
        {
                include(CONST_BasePath.'/lib/template/search-batch-json.php');
                exit;
        }
-       else
+
+       if (!getParamString('q') && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
        {
-               if (!getParamString('q') && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
-               {
-                       $sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
+               $sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
 
-                       // reverse order of '/' separated string
-                       $aPhrases = explode('/', $sQuery);
-                       $aPhrases = array_reverse($aPhrases);
-                       $sQuery = join(', ',$aPhrases);
-                       $oGeocode->setQuery($sQuery);
-               }
-               else
-               {
-                       $oGeocode->setQueryFromParams($_GET);
-               }
+               // reverse order of '/' separated string
+               $aPhrases = explode('/', $sQuery);
+               $aPhrases = array_reverse($aPhrases);
+               $sQuery = join(', ',$aPhrases);
+               $oGeocode->setQuery($sQuery);
+       }
+       else
+       {
+               $oGeocode->setQueryFromParams($_GET);
        }
 
        $hLog = logStart($oDB, 'search', $oGeocode->getQueryString(), $aLangPrefOrder);
        }
        logEnd($oDB, $hLog, sizeof($aSearchResults));
 
-       $bAsText = $oGeocode->getIncludePolygonAsText();
        $sQuery = $oGeocode->getQueryString();
        $sViewBox = $oGeocode->getViewBoxString();
        $bShowPolygons = (isset($_GET['polygon']) && $_GET['polygon']);
        $aExcludePlaceIDs = $oGeocode->getExcludedPlaceIDs();
 
-       $sMoreURL = CONST_Website_BaseURL.'search.php?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$oGeocode->getExcludedPlaceIDs());
+       $sMoreURL = CONST_Website_BaseURL.'search.php?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$aExcludePlaceIDs);
        if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) $sMoreURL .= '&accept-language='.$_SERVER["HTTP_ACCEPT_LANGUAGE"];
        if ($bShowPolygons) $sMoreURL .= '&polygon=1';
        if ($oGeocode->getIncludeAddressDetails()) $sMoreURL .= '&addressdetails=1';