]> 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)
CMakeLists.txt
docs/Installation.md
lib/template/address-html.php
osm2pgsql
tests/features/osm2pgsql/import/tags.feature
vagrant/install-on-centos-7.sh
vagrant/install-on-travis-ci.sh
vagrant/install-on-ubuntu-16.sh
website/reverse.php

index 82676060b32ceb3a03f8ce45107449f18d42db67..71075c8217a19cac82bce792d64465a33b28a7ba 100644 (file)
@@ -32,7 +32,7 @@ add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_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)
 
index 678f055669caaf1067b51a3623cf8734888dda39..7f108160a25e40324e855bea2d83e532cd6ed3e9 100644 (file)
@@ -104,6 +104,7 @@ directory and create an alias:
     <Directory "/srv/nominatim/build/website">
       Options FollowSymLinks MultiViews
       AddType text/html   .php
+      DirectoryIndex search.php
       Require all granted
     </Directory>
     Alias /nominatim /srv/nominatim/build/website
@@ -134,13 +135,15 @@ follows:
 Tell nginx that php files are special and to fastcgi_pass to the php-fpm
 unix socket by adding the location definition to the default configuration.
 
+    root /srv/nominatim/build/website;
+    index search.php index.html;
     location ~ [^/]\.php(/|$) {
         fastcgi_split_path_info ^(.+?\.php)(/.*)$;
         if (!-f $document_root$fastcgi_script_name) {
             return 404;
         }
         fastcgi_pass unix:/var/run/php5-fpm.sock;
-        fastcgi_index index.php;
+        fastcgi_index search.php;
         include fastcgi.conf;
     }
 
index b4c7533e190f52890fbeb2f154e548cfdcf6c1cf..63072911da3579f8169ede7c7c6c6ae52e05335e 100644 (file)
     <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>reverse.php">
         <div class="form-group">
             <input name="format" type="hidden" value="html">
-            <input name="lat" type="text" class="form-control input-sm" placeholder="latitude"  value="<?php echo htmlspecialchars($_GET['lat']); ?>" >
+            <input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo $fLat; ?>" >
             <span id="switch-coords">&lt;&gt;</span>
-            <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo htmlspecialchars($_GET['lon']); ?>" >
+            <input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
             max zoom
 
-            <select name="zoom" class="form-control input-sm" value="<?php echo htmlspecialchars($_GET['zoom']); ?>">
-                <option value="" <?php echo $_GET['zoom']==''?'selected':'' ?> >--</option>
+            <select name="zoom" class="form-control input-sm">
+                <option value="" <?php if ($iZoom === false) echo 'selected="selected"' ?> >--</option>
                 <?php
 
                     $aZoomLevels = array(
@@ -49,8 +49,8 @@
 
                     foreach($aZoomLevels as $iZoomLevel => $sLabel)
                     {
-                        $bSel = isset($_GET['zoom']) && ($_GET['zoom'] == (string)$iZoomLevel);
-                        echo '<option value="'.$iZoomLevel.'"'.($bSel?'selected':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
+                        $bSel = $iZoom === $iZoomLevel;
+                        echo '<option value="'.$iZoomLevel.'"'.($bSel?' selected="selected"':'').'>'.$iZoomLevel.' '.$sLabel.'</option>'."\n";
                     }
                 ?>
             </select>
@@ -66,7 +66,7 @@
 
     <div id="content">
 
-<?php if ($aPlace) { ?>
+<?php if (count($aPlace)>0) { ?>
 
         <div id="searchresults" class="sidebar">
         <?php
     <?php
 
         $aNominatimMapInit = array(
-            'zoom' => isset($_GET['zoom']) ? htmlspecialchars($_GET['zoom']) : CONST_Default_Zoom,
-            'lat'  => isset($_GET['lat']) ? htmlspecialchars($_GET['lat']) : CONST_Default_Lat,
-            'lon'  => isset($_GET['lon']) ? htmlspecialchars($_GET['lon']) : CONST_Default_Lon,
+            'zoom' => $iZoom !== false ? $iZoom : CONST_Default_Zoom,
+            'lat'  => $fLat !== false ? $fLat : CONST_Default_Lat,
+            'lon'  => $fLon !== false ? $fLon : CONST_Default_Lon,
             'tile_url' => $sTileURL,
             'tile_attribution' => $sTileAttribution
         );
index d0af11f267a202c7c1961c2061d121c726d8db3a..45b5ce62f0b31bd4e8ffcb854e7cd0bba88f3496 160000 (submodule)
--- a/osm2pgsql
+++ b/osm2pgsql
@@ -1 +1 @@
-Subproject commit d0af11f267a202c7c1961c2061d121c726d8db3a
+Subproject commit 45b5ce62f0b31bd4e8ffcb854e7cd0bba88f3496
index 149c48138f9e693703c04d2fa1a4dc6affc187b0..3e3d853bf36c05c945ca3d6dceda86a013527f6e 100644 (file)
@@ -92,7 +92,7 @@ Feature: Tag evaluation
          | object | name
          | N1     | 'name: de' : 'Foo', 'name' : 'real1'
          | N2     | 'name: de' : 'Foo', 'name' : 'real2'
-         | N3     | 'name: de' : 'Foo', 'name:\\\\' : 'real3'
+         | N3     | 'name: de' : 'Foo', 'name:\\' : 'real3'
 
     Scenario Outline: Included places
         Given the osm nodes:
index cd1ddfb03b0e9be5ca305cb4ea5abd76c6adabd5..fd50bc52f531eade29083c2d9dc1c974003e9039 100755 (executable)
@@ -104,6 +104,7 @@ sudo tee /etc/httpd/conf.d/nominatim.conf << EOFAPACHECONF
 <Directory "$USERHOME/build/website"> #DOCS:<Directory "$USERHOME/Nominatim/build/website">
   Options FollowSymLinks MultiViews
   AddType text/html   .php
+  DirectoryIndex search.php
   Require all granted
 </Directory>
 
index aca3c66f5a0a62e5d2567627fa51d87aeb827bfc..693be306e90b3292ca3bb61c573fce4402d258f3 100755 (executable)
@@ -41,6 +41,7 @@ sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF > /dev/null
     <Directory "$TRAVIS_BUILD_DIR/build/website">
       Options FollowSymLinks MultiViews
       AddType text/html   .php
+      DirectoryIndex search.php
       Require all granted
     </Directory>
 
index b40dbce1abaa10add924da4983cc14fff0cc80e9..137085a1437b8a46c3f97ae5bae35780468e2d36 100755 (executable)
@@ -104,6 +104,7 @@ sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
 <Directory "$USERHOME/build/website"> #DOCS:<Directory "$USERHOME/Nominatim/build/website">
   Options FollowSymLinks MultiViews
   AddType text/html   .php
+  DirectoryIndex search.php
   Require all granted
 </Directory>
 
index 56b80a5c0b001a7585f6111032574fe2d52b9472..00bcf6356db1ba819058a5df6f2c8a449b5e4bd0 100755 (executable)
@@ -49,11 +49,12 @@ $sOsmType = $oParams->getSet('osm_type', array('N', 'W', 'R'));
 $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 @@ if ($sOsmType && $iOsmId > 0) {
     userError("Need coordinates or OSM object to lookup.");
 }
 
-if ($aPlace) {
+if (isset($aPlace)) {
     $oPlaceLookup->setIncludePolygonAsPoints(false);
     $oPlaceLookup->setIncludePolygonAsText($bAsText);
     $oPlaceLookup->setIncludePolygonAsGeoJSON($bAsGeoJSON);
@@ -86,6 +87,8 @@ if ($aPlace) {
     if ($aOutlineResult) {
         $aPlace = array_merge($aPlace, $aOutlineResult);
     }
+} else {
+    $aPlace = [];
 }
 
 logEnd($oDB, $hLog, sizeof($aPlace)?1:0);
@@ -95,7 +98,7 @@ if (CONST_Debug) {
     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;