About & 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>
<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&status=assigned&status=reopened&component=nominatim&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>
$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);
$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";
}
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";
}