From: marc tobias Date: Sun, 30 Oct 2016 16:07:43 +0000 (+0100) Subject: Tiger: set osmtype=way and correct osm_id X-Git-Tag: v3.0.0~94 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/d93209ee4831d2b32ea743fc2ec0a5feba238dcb Tiger: set osmtype=way and correct osm_id --- diff --git a/lib/Geocode.php b/lib/Geocode.php index a8e4083b..7ea39e49 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -477,12 +477,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, "; diff --git a/lib/output.php b/lib/output.php index 58f00091..fd6226bc 100644 --- a/lib/output.php +++ b/lib/output.php @@ -9,7 +9,7 @@ function formatOSMType($sType, $bIncludeExternal = true) if (!$bIncludeExternal) return ''; - if ($sType == 'T') return 'tiger'; + if ($sType == 'T') return 'way'; if ($sType == 'I') return 'way'; return ''; diff --git a/tests/features/api/search.feature b/tests/features/api/search.feature index 08b2653c..91050daf 100644 --- a/tests/features/api/search.feature +++ b/tests/features/api/search.feature @@ -61,7 +61,7 @@ Feature: Search queries When sending json search query "3 West Victory Way, Craig" Then results contain | osm_type - | tiger + | way @Tiger Scenario: TIGER house number (road fallback)