]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
sMoreURL now includes countrycodes values
[nominatim.git] / lib / Geocode.php
index a8e4083b2c4883238e9d55cf7de0026c23619a17..4809575dba7dfc8b2f14ff543432c4651d654593 100644 (file)
@@ -126,6 +126,12 @@ class Geocode
         return $this->aExcludePlaceIDs;
     }
 
+
+    public function getCountryCodes()
+    {
+        return $this->aCountryCodes;
+    }
+
     public function getViewBoxString()
     {
         if (!$this->aViewBox) return null;
@@ -477,12 +483,13 @@ class Geocode
                 $sHousenumbers .= "(".$placeID.", ".$housenumber.")";
                 if ($i<$length) $sHousenumbers .= ", ";
             }
+
             if (CONST_Use_US_Tiger_Data) {
                 // Tiger search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
                 $sSQL .= " union";
                 $sSQL .= " SELECT ";
                 $sSQL .= "     'T' AS osm_type, ";
-                $sSQL .= "     place_id AS osm_id, ";
+                $sSQL .= "     (SELECT osm_id from placex p WHERE p.place_id=min(blub.parent_place_id)) as osm_id, ";
                 $sSQL .= "     'place' AS class, ";
                 $sSQL .= "     'house' AS type, ";
                 $sSQL .= "     null AS admin_level, ";
@@ -907,6 +914,9 @@ class Geocode
         }
 
         $sQuery = $this->sQuery;
+        if (!preg_match('//u', $sQuery)) {
+            userError("Query string is not UTF-8 encoded.");
+        }
 
         // Conflicts between US state abreviations and various words for 'the' in different languages
         if (isset($this->aLangPrefOrder['name:en'])) {