X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/8b4b647d772e8cee1064043c2a672431051a1db4..e4a51e460e0e7020fed0eeeb8b6cce7148e0bb58:/website/search.php diff --git a/website/search.php b/website/search.php index 0dddacce..0b678caa 100755 --- a/website/search.php +++ b/website/search.php @@ -26,7 +26,8 @@ if (CONST_Search_ReversePlanForAll } // Format for output -$sOutputFormat = $oParams->getSet('format', array('html', 'xml', 'json', 'jsonv2'), 'html'); +$sOutputFormat = $oParams->getSet('format', array('html', 'xml', 'json', 'jsonv2', 'geojson', 'geocodejson'), 'html'); +set_exception_handler_by_format($sOutputFormat); $sForcedGeometry = ($sOutputFormat == 'html') ? 'geojson' : null; $oGeocode->loadParamArray($oParams, $sForcedGeometry); @@ -68,7 +69,7 @@ $aSearchResults = $oGeocode->lookup(); if ($sOutputFormat=='html') { $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1")); } -logEnd($oDB, $hLog, sizeof($aSearchResults)); +logEnd($oDB, $hLog, count($aSearchResults)); $sQuery = $oGeocode->getQueryString(); @@ -81,5 +82,5 @@ $sMoreURL = CONST_Website_BaseURL.'search.php?'.http_build_query($aMoreParams); if (CONST_Debug) exit; -$sOutputTemplate = ($sOutputFormat=='jsonv2' ? 'json' : $sOutputFormat); +$sOutputTemplate = ($sOutputFormat == 'jsonv2') ? 'json' : $sOutputFormat; include(CONST_BasePath.'/lib/template/search-'.$sOutputTemplate.'.php');