]> git.openstreetmap.org Git - nominatim.git/commitdiff
Fix coding style.
authorMarkus Gail <markus.gail.94@gmail.com>
Wed, 23 Mar 2016 08:34:36 +0000 (09:34 +0100)
committerMarkus Gail <markus.gail.94@gmail.com>
Wed, 23 Mar 2016 08:34:36 +0000 (09:34 +0100)
lib/Geocode.php
lib/PlaceLookup.php
lib/lib.php
sql/functions.sql
sql/tiger_import_start.sql
website/details.php

index 4b15b3c814980588f7849f5428f8f574ffd7dad1..481be133513447b4b300200653e62e0b12ab0330 100644 (file)
                        $sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$this->aLangPrefOrder))."]";
 
                        // Get the details for display (is this a redundant extra step?)
-                       $sPlaceIDs = join(',',array_keys($aPlaceIDs));
+                       $sPlaceIDs = join(',', array_keys($aPlaceIDs));
 
                        $sImportanceSQL = '';
                        if ($this->sViewboxSmallSQL) $sImportanceSQL .= " case when ST_Contains($this->sViewboxSmallSQL, ST_Collect(centroid)) THEN 1 ELSE 0.75 END * ";
                                //Tiger search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
                                //only Tiger housenumbers need to be interpolated, because they are saved as lines with start- and endnumber, the common osm housenumbers are usually saved as points
                                $sHousenumbers = "";
-                               $i=0;
-                               $length=count($aPlaceIDs);
-                               foreach($aPlaceIDs as $placeID => $housenumber){
+                               $i = 0;
+                               $length = count($aPlaceIDs);
+                               foreach($aPlaceIDs as $placeID => $housenumber)
+                {
                                        $i++;
                                        $sHousenumbers .= "(".$placeID.", ".$housenumber.")";
                                        if($i<$length)
                        }
 
                        // Do we have anything that looks like a lat/lon pair?
-                       if ( $aLooksLike = looksLikeLatLonPair($sQuery) ){
+                       if ( $aLooksLike = looksLikeLatLonPair($sQuery) )
+            {
                                $this->setNearPoint(array($aLooksLike['lat'], $aLooksLike['lon']));
                                $sQuery = $aLooksLike['query'];
                        }
                                        foreach($aSearches as $aSearch)
                                        {
                                                $iQueryLoop++;
-                                               $searchedHousenumber=-1;
+                                               $searchedHousenumber = -1;
 
                                                if (CONST_Debug) { echo "<hr><b>Search Loop, group $iGroupLoop, loop $iQueryLoop</b>"; }
                                                if (CONST_Debug) _debugDumpGroupedSearches(array($iGroupedRank => array($aSearch)), $aValidTokens);
                                                                if (!sizeof($aPlaceIDs))
                                                                {
                                                                        //new query for lines, not housenumbers anymore
-                                                                       if($searchedHousenumber%2==0){
+                                                                       if($searchedHousenumber%2 == 0){
                                                                                //if housenumber is even, look for housenumber in streets with interpolationtype even or all
                                                                                $sSQL = "select distinct place_id from location_property_tiger where parent_place_id in (".$sPlaceIDs.") and (interpolationtype='even' or interpolationtype='all') and ".$searchedHousenumber.">=startnumber and ".$searchedHousenumber."<=endnumber";
                                                                        }else{
                                                                {
                                                                        $aPlaceIDs = $aRoadPlaceIDs;
                                                                        //set to -1, if no housenumbers were found
-                                                                       $searchedHousenumber=-1;
-                                                               }else{
-                                                                       //housenumber was found, remains saved in searchedHousenumber
+                                                                       $searchedHousenumber = -1;
                                                                }
+                                //else: housenumber was found, remains saved in searchedHousenumber
                                                        }
 
 
                                                if (CONST_Debug) var_dump($sSQL);
                                                $aFilteredPlaceIDs = $this->oDB->getCol($sSQL);
                                                $tempIDs = array();
-                                               foreach($aFilteredPlaceIDs as $placeID){
-                                                       $tempIDs[$placeID]= $aResultPlaceIDs[$placeID];  //assign housenumber to placeID
+                                               foreach($aFilteredPlaceIDs as $placeID)
+                        {
+                                                       $tempIDs[$placeID] = $aResultPlaceIDs[$placeID];  //assign housenumber to placeID
                                                }
-                                               $aResultPlaceIDs=$tempIDs;
+                                               $aResultPlaceIDs = $tempIDs;
                                        }
 
                                        //exit;
index 985ed224a64213f46ddcfd9d5e0d9fa1dbd0b4fd..817d0ec50ce4a2a183b83aa96af5e5bdb63f8863 100644 (file)
@@ -7,7 +7,7 @@
 
                protected $sType = false;
 
-               protected $fTigerFraction =-1;
+               protected $fTigerFraction = -1;
 
                protected $aLangPrefOrder = array();
 
index b2924d5851c6f5daff27e401b843198a95aef7f0..5edd732889cb847247515eff64461eb256007a01 100644 (file)
        }
 
 
-       function getAddressDetails(&$oDB, $sLanguagePrefArraySQL, $iPlaceID, $sCountryCode = false, $housenumber =-1, $bRaw = false)
+       function getAddressDetails(&$oDB, $sLanguagePrefArraySQL, $iPlaceID, $sCountryCode = false, $housenumber = -1, $bRaw = false)
        {
                $sSQL = "select *,get_name_by_language(name,$sLanguagePrefArraySQL) as localname from get_addressdata($iPlaceID, $housenumber)";
                if (!$bRaw) $sSQL .= " WHERE isaddress OR type = 'country_code'";
index e060a26598033e9d93d35111acea4c4a5db361ce..5ec98f205c0e840f8e6f54e242929c1d89a4a47a 100644 (file)
@@ -2196,7 +2196,7 @@ BEGIN
   result := '{}';
   prevresult := '';
 
-  FOR location IN select * from get_addressdata(for_place_id,housenumber) where isaddress order by rank_address desc LOOP
+  FOR location IN select * from get_addressdata(for_place_id, housenumber) where isaddress order by rank_address desc LOOP
     currresult := trim(get_name_by_language(location.name, languagepref));
     IF currresult != prevresult AND currresult IS NOT NULL AND result[(100 - location.rank_address)] IS NULL THEN
       result[(100 - location.rank_address)] := trim(get_name_by_language(location.name, languagepref));
index f6d65ae238e954416fa2c35b39ec7d0366d20334..5acb3e59d6a9e73cdcdf2a894b27ab8bba25b6ac 100644 (file)
@@ -10,7 +10,6 @@ DECLARE
   endnumber INTEGER;
   stepsize INTEGER;
   numberrange INTEGER;
-  rangestartnumber INTEGER;
   place_centroid GEOMETRY;
   out_partition INTEGER;
   out_parent_place_id BIGINT;
@@ -28,8 +27,7 @@ BEGIN
   END IF;
 
   numberrange := endnumber - startnumber;
-  rangestartnumber := startnumber;
-  
+
   IF (interpolationtype = 'odd' AND startnumber%2 = 0) OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN
     startnumber := startnumber + 1;
     stepsize := 2;
index 5b269fc0755ce395a7259fcb98610ad60d2baf34..c7a567552c06afe614cf6ae08b2f0246d31b155f 100755 (executable)
@@ -10,7 +10,7 @@
           $fLoadAvg = getLoadAverage();
           if ($fLoadAvg > 3)
           {
-          echo "Page temporarily blocked due to high server load\n";F
+          echo "Page temporarily blocked due to high server load\n";
           exit;
           }
         */