]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 17 Dec 2016 17:40:57 +0000 (18:40 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 17 Dec 2016 17:40:57 +0000 (18:40 +0100)
1  2 
CMakeLists.txt
website/reverse.php

diff --combined CMakeLists.txt
index 82676060b32ceb3a03f8ce45107449f18d42db67,324b5c915ae21fbe4a5231d2cf13aa91f243e103..71075c8217a19cac82bce792d64465a33b28a7ba
@@@ -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 56b80a5c0b001a7585f6111032574fe2d52b9472,026fa85b434b4dcabc7af6dc2ecf6db1ea3650ba..00bcf6356db1ba819058a5df6f2c8a449b5e4bd0
@@@ -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);
      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;