mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
correctly handle single-point interpolations in reverse
Lookup in location_property_osmline needs to be special cased for startnumber = endnumber. Also adds tests for the case. Fixes #2680.
This commit is contained in:
@@ -64,7 +64,9 @@ class ReverseGeocode
|
||||
{
|
||||
Debug::newFunction('lookupInterpolation');
|
||||
$sSQL = 'SELECT place_id, parent_place_id, 30 as rank_search,';
|
||||
$sSQL .= ' (endnumber - startnumber) * ST_LineLocatePoint(linegeo,'.$sPointSQL.') as fhnr,';
|
||||
$sSQL .= ' (CASE WHEN endnumber != startnumber';
|
||||
$sSQL .= ' THEN (endnumber - startnumber) * ST_LineLocatePoint(linegeo,'.$sPointSQL.')';
|
||||
$sSQL .= ' ELSE startnumber END) as fhnr,';
|
||||
$sSQL .= ' startnumber, endnumber, step,';
|
||||
$sSQL .= ' ST_Distance(linegeo,'.$sPointSQL.') as distance';
|
||||
$sSQL .= ' FROM location_property_osmline';
|
||||
|
||||
Reference in New Issue
Block a user