mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-13 14:24:08 +00:00
cleanup of SQL for readability. No logic change
This commit is contained in:
committed by
Sarah Hoffmann
parent
4f3074e538
commit
eb79e655e6
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user