]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
Merge pull request #969 from mtmail/update-vagrant-md
[nominatim.git] / lib / Geocode.php
index b2eee7ba6b927162e6466c8045c23d85b2ca0b12..26fafb734fa93d2d0beddbff4e52557537d3fad4 100644 (file)
@@ -225,14 +225,14 @@ class Geocode
         $aViewbox = $oParams->getStringList('viewboxlbrt');
         if ($aViewbox) {
             if (count($aViewbox) != 4) {
-                userError("Bad parmater 'viewboxlbrt'. Expected 4 coordinates.");
+                userError("Bad parameter 'viewboxlbrt'. Expected 4 coordinates.");
             }
             $this->setViewbox($aViewbox);
         } else {
             $aViewbox = $oParams->getStringList('viewbox');
             if ($aViewbox) {
                 if (count($aViewbox) != 4) {
-                    userError("Bad parmater 'viewbox'. Expected 4 coordinates.");
+                    userError("Bad parameter 'viewbox'. Expected 4 coordinates.");
                 }
                 $this->setViewBox($aViewbox);
             } else {
@@ -921,12 +921,12 @@ class Geocode
                 $aResult['importance'] = 0.001;
                 $aResult['foundorder'] = $aResult['addressimportance'];
             } else {
-                // Adjust importance for the number of exact string matches in the result
+                $aResult['importance'] = max(0.001, $aResult['importance']);
                 $aResult['importance'] *= $this->viewboxImportanceFactor(
                     $aResult['lon'],
                     $aResult['lat']
                 );
-                $aResult['importance'] = max(0.001, $aResult['importance']);
+                // Adjust importance for the number of exact string matches in the result
                 $iCountWords = 0;
                 $sAddress = $aResult['langaddress'];
                 foreach ($aRecheckWords as $i => $sWord) {