X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/9981d74ee195eae87b4ffe7bd84231166f5740b1..ab54a4b8d7ba75f7a1ecd18de34bbce5af291b5b:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index 269229d3..9660f36d 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -23,7 +23,6 @@ $hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder); $oPlaceLookup = new Nominatim\PlaceLookup($oDB); $oPlaceLookup->loadParamArray($oParams); -$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true)); $sOsmType = $oParams->getSet('osm_type', array('N', 'W', 'R')); $iOsmId = $oParams->getInt('osm_id', -1); @@ -47,7 +46,7 @@ if ($sOsmType && $iOsmId > 0) { } } } elseif ($sOutputFormat != 'html') { - userError("Need coordinates or OSM object to lookup."); + userError('Need coordinates or OSM object to lookup.'); } if (isset($aPlace)) { @@ -66,6 +65,7 @@ if (isset($aPlace)) { $aPlace = []; } +logEnd($oDB, $hLog, sizeof($aPlace)?1:0); if (CONST_Debug) { var_dump($aPlace); @@ -73,8 +73,10 @@ if (CONST_Debug) { } if ($sOutputFormat == 'html') { - $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate - '2 minutes'::interval,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1")); + $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1")); $sTileURL = CONST_Map_Tile_URL; $sTileAttribution = CONST_Map_Tile_Attribution; } -include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php'); + +$sOutputTemplate = ($sOutputFormat=='jsonv2' ? 'json' : $sOutputFormat); +include(CONST_BasePath.'/lib/template/address-'.$sOutputTemplate.'.php');