From: Sarah Hoffmann Date: Wed, 30 Apr 2014 22:11:21 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~538 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/9c6d30ca956849bab8db239627dfdf4f9eeec6bb?hp=a446ea5ffc2e3c559d93f3c4f242ff7a579f0860 Merge remote-tracking branch 'upstream/master' Conflicts: lib/Geocode.php --- diff --git a/lib/Geocode.php b/lib/Geocode.php index 016fc101..1588dff5 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -485,8 +485,6 @@ $sCountryCodesSQL = join(',', array_map('addQuotes', $this->aCountryCodes)); } - // Hack to make it handle "new york, ny" (and variants) correctly - //$sQuery = str_ireplace(array('New York, ny','new york, new york', 'New York ny','new york new york'), 'new york city, ny', $this->sQuery); $sQuery = $this->sQuery; // Conflicts between US state abreviations and various words for 'the' in different languages @@ -498,7 +496,7 @@ } // View Box SQL - $sViewboxCentreSQL; + $sViewboxCentreSQL = false; $bBoundingBoxSearch = false; if ($this->aViewBox) { diff --git a/sql/functions.sql b/sql/functions.sql index 460ec44f..976c73f2 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1427,6 +1427,16 @@ BEGIN -- Note that addr:street links can only be indexed once the street itself is indexed IF NEW.parent_place_id IS NULL AND NEW.osm_type = 'N' THEN + -- if there is no address information, see if we can get it from a surrounding building + IF NEW.street IS NULL AND NEW.addr_place IS NULL AND NEW.housenumber IS NULL THEN + FOR location IN select * from placex where ST_Covers(geometry, place_centroid) and rank_search > 28 and (housenumber is not null or street is not null or addr_place is not null) AND ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') + LOOP + NEW.housenumber := location.housenumber; + NEW.street := location.street; + NEW.addr_place := location.addr_place; + END LOOP; + END IF; + -- Is this node part of a relation? FOR relation IN select * from planet_osm_rels where parts @> ARRAY[NEW.osm_id] and members @> ARRAY['n'||NEW.osm_id] LOOP