forked from hans/Nominatim
details: also look for interpolations when way id is given
This commit is contained in:
@@ -12,6 +12,8 @@ function formatOSMType($sType, $bIncludeExternal = true)
|
|||||||
if ($sType == 'T') return 'way';
|
if ($sType == 'T') return 'way';
|
||||||
if ($sType == 'I') return 'way';
|
if ($sType == 'I') return 'way';
|
||||||
|
|
||||||
|
// not handled: P, L
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,16 @@ if ($sOsmType && $iOsmId > 0) {
|
|||||||
$sSQL .= ' ORDER BY class ASC';
|
$sSQL .= ' ORDER BY class ASC';
|
||||||
$sPlaceId = $oDB->getOne($sSQL, array(':type' => $sOsmType, ':id' => $iOsmId));
|
$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
|
// Be nice about our error messages for broken geometry
|
||||||
|
|
||||||
if (!$sPlaceId) {
|
if (!$sPlaceId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user