<?php
-@define('CONST_ConnectionBucket_PageType', 'Reverse');
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
require_once(CONST_BasePath.'/lib/init-website.php');
require_once(CONST_BasePath.'/lib/log.php');
require_once(CONST_BasePath.'/lib/PlaceLookup.php');
// 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();
$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);
}
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
);
$aPlace = array();
}
+logEnd($oDB, $hLog, sizeof($aPlace)?1:0);
if (CONST_Debug) {
var_dump($aPlace);