X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/80a6751c51614c0d8baf84c0c52ffdc8ef76ff77..d1041979ecfc352399fa8828b771eb559cb57351:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index 9c6368f0..075d4cf0 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -13,6 +13,7 @@ $oParams = new Nominatim\ParameterParser(); // Format for output $sOutputFormat = $oParams->getSet('format', array('html', 'xml', 'json', 'jsonv2', 'geojson', 'geocodejson'), 'xml'); +set_exception_handler_by_format($sOutputFormat); // Preferred language $aLangPrefOrder = $oParams->getPreferredLanguages(); @@ -23,10 +24,7 @@ $hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder); $oPlaceLookup = new Nominatim\PlaceLookup($oDB); $oPlaceLookup->loadParamArray($oParams); -if ($sOutputFormat == 'geocodejson') { - $oPlaceLookup->setIncludeAddressDetails(true); - $oPlaceLookup->setAddressAdminLevels(true); -} +$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true)); $sOsmType = $oParams->getSet('osm_type', array('N', 'W', 'R')); $iOsmId = $oParams->getInt('osm_id', -1); @@ -54,12 +52,11 @@ if ($sOsmType && $iOsmId > 0) { } if (isset($aPlace)) { - $fRadius = $fDiameter = getResultDiameter($aPlace); $aOutlineResult = $oPlaceLookup->getOutlines( $aPlace['place_id'], $aPlace['lon'], $aPlace['lat'], - $fRadius, + Nominatim\ClassTypes\getProperty($aPlace, 'defdiameter', 0.0001), $fLat, $fLon ); @@ -71,6 +68,7 @@ if (isset($aPlace)) { $aPlace = array(); } +logEnd($oDB, $hLog, sizeof($aPlace)?1:0); if (CONST_Debug) { var_dump($aPlace);