From: Sarah Hoffmann Date: Sat, 17 Dec 2016 17:40:57 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~409 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/08f4279b6efd03f83860c90e931625aa435b271e?hp=-c Merge remote-tracking branch 'upstream/master' --- 08f4279b6efd03f83860c90e931625aa435b271e diff --combined CMakeLists.txt index 82676060,324b5c91..71075c82 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -32,7 -32,7 +32,7 @@@ add_definitions(-DNOMINATIM_VERSION="${ # #----------------------------------------------------------------------------- - set(BUILD_TESTS on CACHE BOOL "Build test suite" FORCE) + set(BUILD_TESTS off CACHE BOOL "Build test suite" FORCE) set(WITH_LUA off CACHE BOOL "Build with lua support" FORCE) add_subdirectory(osm2pgsql) @@@ -75,14 -75,6 +75,14 @@@ set(CUSTOMFILE website/reverse.php website/search.php website/status.php + website/403.html + website/509.html + website/crossdomain.xml + website/favicon.ico + website/last_update.php + website/nominatim.xml + website/robots.txt + website/taginfo.json utils/blocks.php utils/country_languages.php utils/imports.php diff --combined website/reverse.php index 56b80a5c,026fa85b..00bcf635 --- a/website/reverse.php +++ b/website/reverse.php @@@ -49,11 -49,12 +49,12 @@@ $sOsmType = $oParams->getSet('osm_type' $iOsmId = $oParams->getInt('osm_id', -1); $fLat = $oParams->getFloat('lat'); $fLon = $oParams->getFloat('lon'); + $iZoom = $oParams->getInt('zoom'); if ($sOsmType && $iOsmId > 0) { $aPlace = $oPlaceLookup->lookupOSMID($sOsmType, $iOsmId); } elseif ($fLat !== false && $fLon !== false) { $oReverseGeocode = new Nominatim\ReverseGeocode($oDB); - $oReverseGeocode->setZoom($oParams->getInt('zoom', 18)); + $oReverseGeocode->setZoom($iZoom !== false ? $iZoom : 18); $aLookup = $oReverseGeocode->lookup($fLat, $fLon); if (CONST_Debug) var_dump($aLookup); @@@ -67,7 -68,7 +68,7 @@@ userError("Need coordinates or OSM object to lookup."); } - if ($aPlace) { + if (isset($aPlace)) { $oPlaceLookup->setIncludePolygonAsPoints(false); $oPlaceLookup->setIncludePolygonAsText($bAsText); $oPlaceLookup->setIncludePolygonAsGeoJSON($bAsGeoJSON); @@@ -86,16 -87,17 +87,18 @@@ if ($aOutlineResult) { $aPlace = array_merge($aPlace, $aOutlineResult); } + } else { + $aPlace = []; } +logEnd($oDB, $hLog, sizeof($aPlace)?1:0); if (CONST_Debug) { var_dump($aPlace); exit; } - if ($sOutputFormat=='html') { + 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")); $sTileURL = CONST_Map_Tile_URL; $sTileAttribution = CONST_Map_Tile_Attribution;