mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83ce6e12e7 | ||
|
|
5b4c7b7f7e | ||
|
|
70997a9554 | ||
|
|
805f16b0cd | ||
|
|
083c55b230 | ||
|
|
a24991b430 | ||
|
|
3b44edf4a5 |
@@ -1,3 +1,8 @@
|
|||||||
|
2.5.1
|
||||||
|
|
||||||
|
* fix layout error in details page when keywords are displayed
|
||||||
|
* fix website check during setup
|
||||||
|
|
||||||
2.5
|
2.5
|
||||||
|
|
||||||
* reverse geocoding includes looking up housenumbers from Tiger data
|
* reverse geocoding includes looking up housenumbers from Tiger data
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT(Nominatim,2.5)
|
AC_INIT(Nominatim,2.5.1)
|
||||||
if git rev-parse HEAD 2>/dev/null >/dev/null; then
|
if git rev-parse HEAD 2>/dev/null >/dev/null; then
|
||||||
AC_SUBST([PACKAGE_VERSION], [$PACKAGE_VERSION-git-`git rev-parse --short HEAD`])
|
AC_SUBST([PACKAGE_VERSION], [$PACKAGE_VERSION-git-`git rev-parse --short HEAD`])
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
function &getDB($bNew = false, $bPersistent = false)
|
function &getDB($bNew = false, $bPersistent = false)
|
||||||
{
|
{
|
||||||
// Get the database object
|
// Get the database object
|
||||||
$oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), $bPersistent);
|
$oDB = DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), $bPersistent);
|
||||||
if (PEAR::IsError($oDB))
|
if (PEAR::IsError($oDB))
|
||||||
{
|
{
|
||||||
var_dump(CONST_Database_DSN);
|
var_dump(CONST_Database_DSN);
|
||||||
|
|||||||
@@ -111,13 +111,13 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$aNominatimMapInit = [
|
$aNominatimMapInit = array(
|
||||||
'zoom' => isset($_GET['zoom']) ? htmlspecialchars($_GET['zoom']) : CONST_Default_Zoom,
|
'zoom' => isset($_GET['zoom']) ? htmlspecialchars($_GET['zoom']) : CONST_Default_Zoom,
|
||||||
'lat' => isset($_GET['lat'] ) ? htmlspecialchars($_GET['lat'] ) : CONST_Default_Lat,
|
'lat' => isset($_GET['lat'] ) ? htmlspecialchars($_GET['lat'] ) : CONST_Default_Lat,
|
||||||
'lon' => isset($_GET['lon'] ) ? htmlspecialchars($_GET['lon'] ) : CONST_Default_Lon,
|
'lon' => isset($_GET['lon'] ) ? htmlspecialchars($_GET['lon'] ) : CONST_Default_Lon,
|
||||||
'tile_url' => $sTileURL,
|
'tile_url' => $sTileURL,
|
||||||
'tile_attribution' => $sTileAttribution
|
'tile_attribution' => $sTileAttribution
|
||||||
];
|
);
|
||||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||||
|
|
||||||
echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
|
||||||
|
|||||||
@@ -113,6 +113,19 @@
|
|||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _one_keyword_row($keyword_token,$word_id){
|
||||||
|
echo "<tr>\n";
|
||||||
|
echo '<td>';
|
||||||
|
// mark partial tokens (those starting with a space) with a star for readability
|
||||||
|
echo ($keyword_token[0]==' '?'*':'');
|
||||||
|
echo $keyword_token;
|
||||||
|
if (isset($word_id))
|
||||||
|
{
|
||||||
|
echo '</td><td>word id: '.$word_id;
|
||||||
|
}
|
||||||
|
echo "</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
@@ -209,7 +222,7 @@
|
|||||||
headline('Name Keywords');
|
headline('Name Keywords');
|
||||||
foreach($aPlaceSearchNameKeywords as $aRow)
|
foreach($aPlaceSearchNameKeywords as $aRow)
|
||||||
{
|
{
|
||||||
echo '<div>'.$aRow['word_token']."</div>\n";
|
_one_keyword_row($aRow['word_token'], $aRow['word_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +231,7 @@
|
|||||||
headline('Address Keywords');
|
headline('Address Keywords');
|
||||||
foreach($aPlaceSearchAddressKeywords as $aRow)
|
foreach($aPlaceSearchAddressKeywords as $aRow)
|
||||||
{
|
{
|
||||||
echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'."</div>\n";
|
_one_keyword_row($aRow['word_token'], $aRow['word_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,17 +277,17 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$aNominatimMapInit = [
|
$aNominatimMapInit = array(
|
||||||
'tile_url' => $sTileURL,
|
'tile_url' => $sTileURL,
|
||||||
'tile_attribution' => $sTileAttribution
|
'tile_attribution' => $sTileAttribution
|
||||||
];
|
);
|
||||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||||
|
|
||||||
$aPlace = [
|
$aPlace = array(
|
||||||
'outlinestring' => $aPointDetails['outlinestring'],
|
'outlinestring' => $aPointDetails['outlinestring'],
|
||||||
'lon' => $aPointDetails['lon'],
|
'lon' => $aPointDetails['lon'],
|
||||||
'lat' => $aPointDetails['lat'],
|
'lat' => $aPointDetails['lat'],
|
||||||
];
|
);
|
||||||
echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="last-updated" class="col-xs-4 text-center">
|
<div id="last-updated" class="col-xs-4 text-center">
|
||||||
<?php if ($sDataDate){ ?>
|
<?php if (isset($sDataDate)){ ?>
|
||||||
Data last updated:
|
Data last updated:
|
||||||
<br>
|
<br>
|
||||||
<?php echo $sDataDate; ?>
|
<?php echo $sDataDate; ?>
|
||||||
|
|||||||
@@ -96,13 +96,13 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$aNominatimMapInit = [
|
$aNominatimMapInit = array(
|
||||||
'zoom' => $iZoom,
|
'zoom' => $iZoom,
|
||||||
'lat' => $fLat,
|
'lat' => $fLat,
|
||||||
'lon' => $fLon,
|
'lon' => $fLon,
|
||||||
'tile_url' => $sTileURL,
|
'tile_url' => $sTileURL,
|
||||||
'tile_attribution' => $sTileAttribution
|
'tile_attribution' => $sTileAttribution
|
||||||
];
|
);
|
||||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||||
|
|
||||||
echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
|
echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
if (isset($aCMDResult['bounded'])) $aCMDResult['bounded'] = 'true';
|
if (isset($aCMDResult['bounded'])) $aCMDResult['bounded'] = 'true';
|
||||||
if (isset($aCMDResult['nodedupe'])) $aCMDResult['dedupe'] = 'false';
|
if (isset($aCMDResult['nodedupe'])) $aCMDResult['dedupe'] = 'false';
|
||||||
|
|
||||||
$oGeocode =& new Geocode($oDB);
|
$oGeocode = new Geocode($oDB);
|
||||||
if (isset($aCMDResult['accept-language']) && $aCMDResult['accept-language'])
|
if (isset($aCMDResult['accept-language']) && $aCMDResult['accept-language'])
|
||||||
$oGeocode->setLanguagePreference(getPreferredLanguages($aCMDResult['accept-language']));
|
$oGeocode->setLanguagePreference(getPreferredLanguages($aCMDResult['accept-language']));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
{
|
{
|
||||||
echo "Create DB\n";
|
echo "Create DB\n";
|
||||||
$bDidSomething = true;
|
$bDidSomething = true;
|
||||||
$oDB =& DB::connect(CONST_Database_DSN, false);
|
$oDB = DB::connect(CONST_Database_DSN, false);
|
||||||
if (!PEAR::isError($oDB))
|
if (!PEAR::isError($oDB))
|
||||||
{
|
{
|
||||||
fail('database already exists ('.CONST_Database_DSN.')');
|
fail('database already exists ('.CONST_Database_DSN.')');
|
||||||
@@ -722,7 +722,7 @@
|
|||||||
@symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css');
|
@symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css');
|
||||||
echo "Symlinks created\n";
|
echo "Symlinks created\n";
|
||||||
|
|
||||||
$sTestFile = @file_get_contents(CONST_Website_BaseURL.'js/tiles.js');
|
$sTestFile = @file_get_contents(CONST_Website_BaseURL.'js/nominatim-ui.js');
|
||||||
if (!$sTestFile)
|
if (!$sTestFile)
|
||||||
{
|
{
|
||||||
echo "\nWARNING: Unable to access the website at ".CONST_Website_BaseURL."\n";
|
echo "\nWARNING: Unable to access the website at ".CONST_Website_BaseURL."\n";
|
||||||
|
|||||||
@@ -159,7 +159,12 @@
|
|||||||
|
|
||||||
logEnd($oDB, $hLog, 1);
|
logEnd($oDB, $hLog, 1);
|
||||||
|
|
||||||
$sTileURL = CONST_Map_Tile_URL;
|
if ($sOutputFormat=='html')
|
||||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
{
|
||||||
|
$sDataDate = $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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');
|
include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');
|
||||||
|
|||||||
@@ -76,6 +76,10 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sTileURL = CONST_Map_Tile_URL;
|
if ($sOutputFormat=='html')
|
||||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
{
|
||||||
|
$sDataDate = $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;
|
||||||
|
}
|
||||||
include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');
|
include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
$fLat = CONST_Default_Lat;
|
$fLat = CONST_Default_Lat;
|
||||||
$fLon = CONST_Default_Lon;
|
$fLon = CONST_Default_Lon;
|
||||||
$iZoom = CONST_Default_Zoom;
|
$iZoom = CONST_Default_Zoom;
|
||||||
$sTileURL = CONST_Map_Tile_URL;
|
|
||||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
|
||||||
|
|
||||||
$oGeocode =& new Geocode($oDB);
|
$oGeocode =& new Geocode($oDB);
|
||||||
|
|
||||||
@@ -99,17 +97,17 @@
|
|||||||
{
|
{
|
||||||
if (!(isset($_GET['q']) && $_GET['q']) && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
|
if (!(isset($_GET['q']) && $_GET['q']) && isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'][0] == '/')
|
||||||
{
|
{
|
||||||
$sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
|
$sQuery = substr(rawurldecode($_SERVER['PATH_INFO']), 1);
|
||||||
|
|
||||||
// reverse order of '/' separated string
|
// reverse order of '/' separated string
|
||||||
$aPhrases = explode('/', $sQuery);
|
$aPhrases = explode('/', $sQuery);
|
||||||
$aPhrases = array_reverse($aPhrases);
|
$aPhrases = array_reverse($aPhrases);
|
||||||
$sQuery = join(', ',$aPhrases);
|
$sQuery = join(', ',$aPhrases);
|
||||||
$oGeocode->setQuery($sQuery);
|
$oGeocode->setQuery($sQuery);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oGeocode->setQueryFromParams($_GET);
|
$oGeocode->setQueryFromParams($_GET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +116,12 @@
|
|||||||
$aSearchResults = $oGeocode->lookup();
|
$aSearchResults = $oGeocode->lookup();
|
||||||
if ($aSearchResults === false) $aSearchResults = array();
|
if ($aSearchResults === false) $aSearchResults = array();
|
||||||
|
|
||||||
$sDataDate = $oDB->getOne("select TO_CHAR(lastimportdate - '2 minutes'::interval,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1");
|
if ($sOutputFormat=='html')
|
||||||
|
{
|
||||||
|
$sDataDate = $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;
|
||||||
|
}
|
||||||
logEnd($oDB, $hLog, sizeof($aSearchResults));
|
logEnd($oDB, $hLog, sizeof($aSearchResults));
|
||||||
|
|
||||||
$bAsText = $oGeocode->getIncludePolygonAsText();
|
$bAsText = $oGeocode->getIncludePolygonAsText();
|
||||||
|
|||||||
Reference in New Issue
Block a user