From: Sarah Hoffmann Date: Sun, 9 Feb 2020 15:50:04 +0000 (+0100) Subject: details: also look for interpolations when way id is given X-Git-Tag: v3.5.0~86^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/97d87895bff0e23ace74b616333b6b347c57f5b3?ds=inline;hp=-c details: also look for interpolations when way id is given --- 97d87895bff0e23ace74b616333b6b347c57f5b3 diff --git a/lib/output.php b/lib/output.php index 4a15ecde..823a6631 100644 --- a/lib/output.php +++ b/lib/output.php @@ -12,6 +12,8 @@ function formatOSMType($sType, $bIncludeExternal = true) if ($sType == 'T') return 'way'; if ($sType == 'I') return 'way'; + // not handled: P, L + return ''; } diff --git a/website/details.php b/website/details.php index 44d4956b..39fa0afa 100644 --- a/website/details.php +++ b/website/details.php @@ -44,6 +44,16 @@ if ($sOsmType && $iOsmId > 0) { $sSQL .= ' ORDER BY class ASC'; $sPlaceId = $oDB->getOne($sSQL, array(':type' => $sOsmType, ':id' => $iOsmId)); + + // Nothing? Maybe it's an interpolation. + // XXX Simply returns the first parent street it finds. It should + // get a house number and get the right interpolation. + if (!$sPlaceId && $sOsmType == 'W' && (!$sClass || $sClass == 'place')) { + $sSQL = 'SELECT place_id FROM location_property_osmline' + .' WHERE osm_id = :id LIMIT 1'; + $sPlaceId = $oDB->getOne($sSQL, array(':id' => $iOsmId)); + } + // Be nice about our error messages for broken geometry if (!$sPlaceId) {