]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 14 Jan 2020 20:56:02 +0000 (21:56 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 14 Jan 2020 20:56:02 +0000 (21:56 +0100)
lib/template/includes/html-top-navigation.php
lib/template/includes/introduction.php
lib/template/includes/report-errors.php
utils/check_import_finished.php
utils/warm.php

index 41b638ab5898d1af218c2a8c6afd4ef165d46142..0047e59cc9b078e0a3fbe5afcec46da2bb42d5bc 100644 (file)
                     About &amp; Help <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu dropdown-menu-right">
-                    <li><a href="https://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a></li>
-                    <li><a href="https://wiki.openstreetmap.org/wiki/Nominatim/FAQ" target="_blank">FAQ</a></li>
+                    <li><a href="https://nominatim.org/release-docs/develop/api/Overview/" target="_blank">API Reference</a></li>
+                    <li><a href="https://nominatim.org/release-docs/develop/api/Faq/" target="_blank">FAQ</a></li>
+                    <li><a href="https://help.openstreetmap.org/tags/nominatim/">OpenStreetMap Help</a></li>
+                    <li><a href="https://github.com/openstreetmap/Nominatim">Nominatim on Github</a></li>
                     <li role="separator" class="divider"></li>
                     <li><a href="#" class="" data-toggle="modal" data-target="#report-modal">Report problem with results</a></li>
                 </ul>
index f089881faac81594961b933561ef6fda99ce5e03..ce136d2d950188f8291267545a7628ba2e0a0cfe 100644 (file)
@@ -6,6 +6,6 @@ look up data by its geographic coordinate (reverse search). Each result comes wi
 link to a details page where you can inspect what data about the object is saved in 
 the database and investigate how the address of the object has been computed.</p>
 
-<p>For more information visit the <a href="https://wiki.openstreetmap.org/wiki/Nominatim">Nominatim wiki page</a>.</p>
+<p>For more information visit the <a href="https://nominatim.org">Nominatim home page</a>.</p>
 
 <p>All usage of nominatim.openstreetmap.org must follow the <a href="https://operations.osmfoundation.org/policies/nominatim/">Nominatim Usage Policy</a>.</p>
index 05a47c8b28de1832b751f8539aceb4503a222bf7..c5dc1e7f8250340e4e4d3493e2bc38435c09f35f 100644 (file)
@@ -1,24 +1,42 @@
 <p>
-    Before reporting problems please read the <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Nominatim">user documentation</a>
-    and
-    <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Nominatim/FAQ">FAQ</a>.
+    Before reporting problems please read the <a target="_blank" href="https://nominatim.org/release-docs/develop/api/Overview">user documentation</a>.
+
+    <h4>Finding the expected result</h4>
+
+    First of all, please make sure that the result that you expect is
+    available in the OpenStreetMap data.
+
+    To find the OpenStreetMap data, do the following:
+
+    <ul>
+     <li>Go to <a href="https://openstreetmap.org">https://openstreetmap.org</a>.</li>
+     <li>Go to the area of the map where you expect the result
+         and zoom in until you see the object you are looking for.</li>
+     <li>Click on the question mark on the right side of the map,
+         then with the question cursor on the map where your object is located.</li>
+     <li>Find the object of interest in the list that appears on the left side.</li>
+     <li>Click on the object and note down the URL that the browser shows.</li>
+    </ul>
+
+    If you cannot find the data you are looking for, there is a good chance
+    that it has not been entered yet. You should <a href="https://www.openstreetmap.org/fixthemap">report or fix the problem in OpenStreetMap</a> directly.
+
+    <h4>Reporting bad searches</h4>
+
+    Problems may be reported at the <a target="_blank" href="https://github.com/openstreetmap/nominatim/issues">issue tracker on github</a>. Please read through
+    the open tickets first and check if your problem has not already been
+    reported.
+
+    When reporting a problem, include the following:
+
+    <ul>
+      <li>A full description of the problem, including the exact term you
+          were searching for.</li>
+      <li>The result you get.</li>
+      <li>The OpenStreetMap object you expect to find (see above).</li>
+    </ul>
+
+    For general questions about installing and searching in Nominatim, please
+    use <a href="https://help.openstreetmap.org/tags/nominatim/">Help OpenStreetMap</a>.
 
-    If your problem relates to the address of a particular search result please use the 'details' link 
-    to check how the address was generated before reporting a problem.
-</p>
-<p>
-    Use <a target="_blank" href="https://github.com/openstreetmap/nominatim/issues">Nominatim issues on github</a>
-    to report problems.
-<!-- You can search for existing bug reports
-    <a href="https://trac.openstreetmap.org/query?status=new&amp;status=assigned&amp;status=reopened&amp;component=nominatim&amp;order=priority">here</a>.</p>
- -->
-</p>
-<p>
-    Please ensure that you include a full description of the problem, including the search
-    query that you used, the problem with the result and, if the problem relates to missing data,
-    the osm type (node, way, relation) and id of the item that is missing.
-</p>
-<p>
-    Problems that contain enough detail are likely to get looked at before ones that require
-    significant research.
 </p>
index 7828f5cff03de17103de1a867fb0c833df5ca8ca..c6ccb67b392e858ca91d4144c3710e9858e95b84 100755 (executable)
@@ -130,6 +130,32 @@ END;
     }
 }
 
+echo 'Checking search indices are valid ... ';
+$sSQL = <<< END
+    SELECT relname
+    FROM pg_class, pg_index
+    WHERE pg_index.indisvalid = false
+      AND pg_index.indexrelid = pg_class.oid;
+END;
+$aInvalid = $oDB->getCol($sSQL);
+if (empty($aInvalid)) {
+    $print_success();
+} else {
+    $print_fail();
+    echo <<< END
+    At least one index is invalid. That can happen, e.g. when index creation was
+    disrupted and later restarted. You should delete the affected indices and
+    run the index stage of setup again.
+    See the question 'Can a stopped/killed import process be resumed?' in the
+    troubleshooting guide.
+    Affected indices: 
+END;
+    echo join(', ', $aInvalid) . "\n";
+    exit(1);
+}
+
+
+
 if (CONST_Use_US_Tiger_Data) {
     echo 'Checking TIGER table exists ... ';
     if ($oDB->tableExists('location_property_tiger')) {
index 8ba746a2a51328eab92446fbd6a70edd060bd4af..5476eae04ffe014bfb7243e8982d6bac5a2be3ac 100644 (file)
@@ -23,6 +23,19 @@ $oDB->connect();
 
 $bVerbose = $aResult['verbose'];
 
+function print_results($aResults, $bVerbose)
+{
+    if ($bVerbose) {
+        if ($aResults && count($aResults)) {
+            echo $aResults[0]['langaddress']."\n";
+        } else {
+            echo "<not found>\n";
+        }
+    } else {
+        echo '.';
+    }
+}
+
 if (!$aResult['search-only']) {
     $oReverseGeocode = new Nominatim\ReverseGeocode($oDB);
     $oReverseGeocode->setZoom(20);
@@ -36,13 +49,10 @@ if (!$aResult['search-only']) {
         $fLat = rand(-9000, 9000) / 100;
         $fLon = rand(-18000, 18000) / 100;
         if ($bVerbose) echo "$fLat, $fLon = ";
+
         $oLookup = $oReverseGeocode->lookup($fLat, $fLon);
-        if ($oLookup) {
-            $aDetails = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup));
-            if ($bVerbose) echo $aDetails['langaddress']."\n";
-        } else {
-            echo '.';
-        }
+        $aSearchResults = $oLookup ? $oPlaceLookup->lookup(array($oLookup->iId => $oLookup)) : null;
+        print_results($aSearchResults, $bVerbose);
     }
     echo "\n";
 }
@@ -52,13 +62,14 @@ if (!$aResult['reverse-only']) {
 
     echo 'Warm search: ';
     if ($bVerbose) echo "\n";
-    $sSQL = 'select word from word where word is not null order by search_name_count desc limit 1000';
+    $sSQL = 'SELECT word FROM word WHERE word is not null ORDER BY search_name_count DESC LIMIT 1000';
     foreach ($oDB->getCol($sSQL) as $sWord) {
         if ($bVerbose) echo "$sWord = ";
+
         $oGeocode->setLanguagePreference(array('en'));
         $oGeocode->setQuery($sWord);
         $aSearchResults = $oGeocode->lookup();
-        if ($bVerbose) echo $aSearchResults[0]['langaddress']."\n";
-        else echo '.';
+        print_results($aSearchResults, $bVerbose);
     }
+    echo "\n";
 }