From: marc tobias Date: Sun, 30 Oct 2016 12:57:48 +0000 (+0100) Subject: cleanup of SQL for readability. No logic change X-Git-Tag: v3.0.0~95 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/eb79e655e638a4345a130ceef6b0d31a1ab5b1f9 cleanup of SQL for readability. No logic change --- diff --git a/lib/Geocode.php b/lib/Geocode.php index c234c5f2..a8e4083b 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -532,7 +532,7 @@ class Geocode $sSQL .= " UNION "; $sSQL .= "SELECT "; $sSQL .= " 'W' AS osm_type, "; - $sSQL .= " place_id AS osm_id, "; + $sSQL .= " osm_id, "; $sSQL .= " 'place' AS class, "; $sSQL .= " 'house' AS type, "; $sSQL .= " null AS admin_level, "; @@ -563,6 +563,7 @@ class Geocode $sSQL .= " null AS extra_place "; $sSQL .= " FROM ("; $sSQL .= " SELECT "; + $sSQL .= " osm_id, "; $sSQL .= " place_id, "; $sSQL .= " calculated_country_code, "; $sSQL .= " CASE "; // interpolate the housenumbers here diff --git a/tests/features/db/import/interpolation.feature b/tests/features/db/import/interpolation.feature index 1c05a882..6974e7be 100644 --- a/tests/features/db/import/interpolation.feature +++ b/tests/features/db/import/interpolation.feature @@ -207,7 +207,6 @@ Feature: Import of address interpolations | startnumber | endnumber | geometry | 2 | 6 | 0 0, 0 0.001 - Scenario: addr:street on interpolation way Given the scene parallel-road And the place nodes @@ -239,6 +238,18 @@ Feature: Import of address interpolations | object | parent_place_id | startnumber | endnumber | W10 | W2 | 2 | 6 | W11 | W3 | 12 | 16 + When sending query "16 Cloud Street" + Then results contain + | ID | osm_type | osm_id + | 0 | N | 4 + When sending query "14 Cloud Street" + Then results contain + | ID | osm_type | osm_id + | 0 | W | 11 + When sending query "18 Cloud Street" + Then results contain + | ID | osm_type | osm_id + | 0 | W | 3 Scenario: addr:street on housenumber way Given the scene parallel-road @@ -271,6 +282,14 @@ Feature: Import of address interpolations | object | parent_place_id | startnumber | endnumber | W10 | W2 | 2 | 6 | W11 | W3 | 12 | 16 + When sending query "16 Cloud Street" + Then results contain + | ID | osm_type | osm_id + | 0 | N | 4 + When sending query "14 Cloud Street" + Then results contain + | ID | osm_type | osm_id + | 0 | W | 11 Scenario: Geometry of points and way don't match (github #253) Given the place nodes diff --git a/website/details.php b/website/details.php index 0b21123d..0dc3397a 100755 --- a/website/details.php +++ b/website/details.php @@ -69,6 +69,11 @@ if (CONST_Use_US_Tiger_Data) { if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; } +// interpolated house numbers +$iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_osmline WHERE place_id = '.$iPlaceID)); +if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; + + if (CONST_Use_Aux_Location_data) { $iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_aux WHERE place_id = '.$iPlaceID)); if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;