X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4a2c9431eea3ecb981a8fd4597cfe5d0149a0a78..5d656891ba072d88b8b281d239d0dce9f7bd6a1c:/website/lookup.php?ds=sidebyside diff --git a/website/lookup.php b/website/lookup.php index e5f01232..737edc62 100644 --- a/website/lookup.php +++ b/website/lookup.php @@ -1,9 +1,9 @@ getPreferredLanguages(); -$oDB = new Nominatim\DB(); +$oDB = new Nominatim\DB(CONST_Database_DSN); $oDB->connect(); $hLog = logStart($oDB, 'place', $_SERVER['QUERY_STRING'], $aLangPrefOrder); @@ -53,6 +53,18 @@ foreach ($aOsmIds as $sItem) { unset($oResult['langaddress']); $oResult['name'] = $oPlace['langaddress']; } + + $aOutlineResult = $oPlaceLookup->getOutlines( + $oPlace['place_id'], + $oPlace['lon'], + $oPlace['lat'], + Nominatim\ClassTypes\getDefRadius($oPlace) + ); + + if ($aOutlineResult) { + $oResult = array_merge($oResult, $aOutlineResult); + } + $aSearchResults[] = $oResult; } } @@ -69,5 +81,7 @@ $bShowPolygons = ''; $aExcludePlaceIDs = array(); $sMoreURL = ''; +logEnd($oDB, $hLog, 1); + $sOutputTemplate = ($sOutputFormat == 'jsonv2') ? 'json' : $sOutputFormat; -include(CONST_BasePath.'/lib/template/search-'.$sOutputTemplate.'.php'); +include(CONST_LibDir.'/template/search-'.$sOutputTemplate.'.php');