mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
Tiger: set osmtype=way and correct osm_id
This commit is contained in:
committed by
Sarah Hoffmann
parent
eb79e655e6
commit
d93209ee48
@@ -477,12 +477,13 @@ class Geocode
|
|||||||
$sHousenumbers .= "(".$placeID.", ".$housenumber.")";
|
$sHousenumbers .= "(".$placeID.", ".$housenumber.")";
|
||||||
if ($i<$length) $sHousenumbers .= ", ";
|
if ($i<$length) $sHousenumbers .= ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONST_Use_US_Tiger_Data) {
|
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)
|
// 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 .= " union";
|
||||||
$sSQL .= " SELECT ";
|
$sSQL .= " SELECT ";
|
||||||
$sSQL .= " 'T' AS osm_type, ";
|
$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 .= " 'place' AS class, ";
|
||||||
$sSQL .= " 'house' AS type, ";
|
$sSQL .= " 'house' AS type, ";
|
||||||
$sSQL .= " null AS admin_level, ";
|
$sSQL .= " null AS admin_level, ";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function formatOSMType($sType, $bIncludeExternal = true)
|
|||||||
|
|
||||||
if (!$bIncludeExternal) return '';
|
if (!$bIncludeExternal) return '';
|
||||||
|
|
||||||
if ($sType == 'T') return 'tiger';
|
if ($sType == 'T') return 'way';
|
||||||
if ($sType == 'I') return 'way';
|
if ($sType == 'I') return 'way';
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ Feature: Search queries
|
|||||||
When sending json search query "3 West Victory Way, Craig"
|
When sending json search query "3 West Victory Way, Craig"
|
||||||
Then results contain
|
Then results contain
|
||||||
| osm_type
|
| osm_type
|
||||||
| tiger
|
| way
|
||||||
|
|
||||||
@Tiger
|
@Tiger
|
||||||
Scenario: TIGER house number (road fallback)
|
Scenario: TIGER house number (road fallback)
|
||||||
|
|||||||
Reference in New Issue
Block a user