]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
Merge pull request #497 from lonvia/forbid-execution-from-sourcedir
[nominatim.git] / lib / Geocode.php
index ce77862b8004086520b55f738d0756c252cd9c59..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;
 
                        if (CONST_Debug) { echo '<i>Recheck words:<\i>'; var_dump($aRecheckWords); }
 
+                       $oPlaceLookup = new PlaceLookup($this->oDB);
+                       $oPlaceLookup->setIncludePolygonAsPoints($this->bIncludePolygonAsPoints);
+                       $oPlaceLookup->setIncludePolygonAsText($this->bIncludePolygonAsText);
+                       $oPlaceLookup->setIncludePolygonAsGeoJSON($this->bIncludePolygonAsGeoJSON);
+                       $oPlaceLookup->setIncludePolygonAsKML($this->bIncludePolygonAsKML);
+                       $oPlaceLookup->setIncludePolygonAsSVG($this->bIncludePolygonAsSVG);
+                       $oPlaceLookup->setPolygonSimplificationThreshold($this->fPolygonSimplificationThreshold);
+
                        foreach($aSearchResults as $iResNum => $aResult)
                        {
                                // Default
                                $fDiameter = getResultDiameter($aResult);
 
-                               $oPlaceLookup = new PlaceLookup($this->oDB);
-                               $oPlaceLookup->setIncludePolygonAsPoints($this->bIncludePolygonAsPoints);
-                               $oPlaceLookup->setIncludePolygonAsText($this->bIncludePolygonAsText);
-                               $oPlaceLookup->setIncludePolygonAsGeoJSON($this->bIncludePolygonAsGeoJSON);
-                               $oPlaceLookup->setIncludePolygonAsKML($this->bIncludePolygonAsKML);
-                               $oPlaceLookup->setIncludePolygonAsSVG($this->bIncludePolygonAsSVG);
-                               $oPlaceLookup->setPolygonSimplificationThreshold($this->fPolygonSimplificationThreshold);
-
                                $aOutlineResult = $oPlaceLookup->getOutlines($aResult['place_id'], $aResult['lon'], $aResult['lat'], $fDiameter/2);
                                if ($aOutlineResult)
                                {