mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 10:27:57 +00:00
Compare commits
10 Commits
docs-3.6.x
...
2.5.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
567d81d10d | ||
|
|
6d77c08269 | ||
|
|
f42ae6b2f6 | ||
|
|
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
|
||||
|
||||
* 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
|
||||
AC_SUBST([PACKAGE_VERSION], [$PACKAGE_VERSION-git-`git rev-parse --short HEAD`])
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
function &getDB($bNew = false, $bPersistent = false)
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
var_dump(CONST_Database_DSN);
|
||||
|
||||
@@ -111,16 +111,16 @@
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
|
||||
$aNominatimMapInit = [
|
||||
$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,
|
||||
'tile_url' => $sTileURL,
|
||||
'tile_attribution' => $sTileAttribution
|
||||
];
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||
);
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit) . ';';
|
||||
|
||||
echo 'var nominatim_results = ' . json_encode([$aPlace], JSON_PRETTY_PRINT) . ';';
|
||||
echo 'var nominatim_results = ' . json_encode([$aPlace]) . ';';
|
||||
?>
|
||||
</script>
|
||||
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
|
||||
|
||||
@@ -113,6 +113,19 @@
|
||||
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');
|
||||
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');
|
||||
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,18 +277,18 @@
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
|
||||
$aNominatimMapInit = [
|
||||
$aNominatimMapInit = array(
|
||||
'tile_url' => $sTileURL,
|
||||
'tile_attribution' => $sTileAttribution
|
||||
];
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||
);
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit) . ';';
|
||||
|
||||
$aPlace = [
|
||||
$aPlace = array(
|
||||
'outlinestring' => $aPointDetails['outlinestring'],
|
||||
'lon' => $aPointDetails['lon'],
|
||||
'lat' => $aPointDetails['lat'],
|
||||
];
|
||||
echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';';
|
||||
);
|
||||
echo 'var nominatim_result = ' . json_encode($aPlace) . ';';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="last-updated" class="col-xs-4 text-center">
|
||||
<?php if ($sDataDate){ ?>
|
||||
<?php if (isset($sDataDate)){ ?>
|
||||
Data last updated:
|
||||
<br>
|
||||
<?php echo $sDataDate; ?>
|
||||
|
||||
@@ -96,16 +96,16 @@
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
|
||||
$aNominatimMapInit = [
|
||||
$aNominatimMapInit = array(
|
||||
'zoom' => $iZoom,
|
||||
'lat' => $fLat,
|
||||
'lon' => $fLon,
|
||||
'tile_url' => $sTileURL,
|
||||
'tile_attribution' => $sTileAttribution
|
||||
];
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
|
||||
);
|
||||
echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit) . ';';
|
||||
|
||||
echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
|
||||
echo 'var nominatim_results = ' . json_encode($aSearchResults) . ';';
|
||||
?>
|
||||
</script>
|
||||
<?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if (isset($aCMDResult['bounded'])) $aCMDResult['bounded'] = 'true';
|
||||
if (isset($aCMDResult['nodedupe'])) $aCMDResult['dedupe'] = 'false';
|
||||
|
||||
$oGeocode =& new Geocode($oDB);
|
||||
$oGeocode = new Geocode($oDB);
|
||||
if (isset($aCMDResult['accept-language']) && $aCMDResult['accept-language'])
|
||||
$oGeocode->setLanguagePreference(getPreferredLanguages($aCMDResult['accept-language']));
|
||||
else
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
{
|
||||
echo "Create DB\n";
|
||||
$bDidSomething = true;
|
||||
$oDB =& DB::connect(CONST_Database_DSN, false);
|
||||
$oDB = DB::connect(CONST_Database_DSN, false);
|
||||
if (!PEAR::isError($oDB))
|
||||
{
|
||||
fail('database already exists ('.CONST_Database_DSN.')');
|
||||
@@ -722,7 +722,7 @@
|
||||
@symlink(CONST_BasePath.'/website/css', $sTargetDir.'/css');
|
||||
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)
|
||||
{
|
||||
echo "\nWARNING: Unable to access the website at ".CONST_Website_BaseURL."\n";
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
$aPointDetails['aNames'] = $oDB->getAssoc($sSQL);
|
||||
if (PEAR::isError($aPointDetails['aNames'])) // possible timeout
|
||||
{
|
||||
$aPointDetails['aNames'] = [];
|
||||
$aPointDetails['aNames'] = array();
|
||||
}
|
||||
|
||||
// Extra tags
|
||||
@@ -98,7 +98,7 @@
|
||||
$aPointDetails['aExtraTags'] = $oDB->getAssoc($sSQL);
|
||||
if (PEAR::isError($aPointDetails['aExtraTags'])) // possible timeout
|
||||
{
|
||||
$aPointDetails['aExtraTags'] = [];
|
||||
$aPointDetails['aExtraTags'] = array();
|
||||
}
|
||||
|
||||
// Address
|
||||
@@ -113,7 +113,7 @@
|
||||
$aLinkedLines = $oDB->getAll($sSQL);
|
||||
if (PEAR::isError($aLinkedLines)) // possible timeout
|
||||
{
|
||||
$aLinkedLines = [];
|
||||
$aLinkedLines = array();
|
||||
}
|
||||
|
||||
// All places this is an imediate parent of
|
||||
@@ -126,7 +126,7 @@
|
||||
$aParentOfLines = $oDB->getAll($sSQL);
|
||||
if (PEAR::isError($aParentOfLines)) // possible timeout
|
||||
{
|
||||
$aParentOfLines = [];
|
||||
$aParentOfLines = array();
|
||||
}
|
||||
|
||||
$aPlaceSearchNameKeywords = false;
|
||||
@@ -137,14 +137,14 @@
|
||||
$aPlaceSearchName = $oDB->getRow($sSQL);
|
||||
if (PEAR::isError($aPlaceSearchName)) // possible timeout
|
||||
{
|
||||
$aPlaceSearchName = [];
|
||||
$aPlaceSearchName = array();
|
||||
}
|
||||
|
||||
$sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['name_vector'],1,-1).")";
|
||||
$aPlaceSearchNameKeywords = $oDB->getAll($sSQL);
|
||||
if (PEAR::isError($aPlaceSearchNameKeywords)) // possible timeout
|
||||
{
|
||||
$aPlaceSearchNameKeywords = [];
|
||||
$aPlaceSearchNameKeywords = array();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,14 +152,19 @@
|
||||
$aPlaceSearchAddressKeywords = $oDB->getAll($sSQL);
|
||||
if (PEAR::isError($aPlaceSearchAddressKeywords)) // possible timeout
|
||||
{
|
||||
$aPlaceSearchAddressKeywords = [];
|
||||
$aPlaceSearchAddressKeywords = array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
logEnd($oDB, $hLog, 1);
|
||||
|
||||
$sTileURL = CONST_Map_Tile_URL;
|
||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');
|
||||
|
||||
@@ -76,6 +76,10 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
$sTileURL = CONST_Map_Tile_URL;
|
||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
||||
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;
|
||||
}
|
||||
include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
$fLat = CONST_Default_Lat;
|
||||
$fLon = CONST_Default_Lon;
|
||||
$iZoom = CONST_Default_Zoom;
|
||||
$sTileURL = CONST_Map_Tile_URL;
|
||||
$sTileAttribution = CONST_Map_Tile_Attribution;
|
||||
|
||||
$oGeocode =& new Geocode($oDB);
|
||||
|
||||
@@ -99,17 +97,17 @@
|
||||
{
|
||||
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
|
||||
$aPhrases = explode('/', $sQuery);
|
||||
$aPhrases = array_reverse($aPhrases);
|
||||
$sQuery = join(', ',$aPhrases);
|
||||
$oGeocode->setQuery($sQuery);
|
||||
// reverse order of '/' separated string
|
||||
$aPhrases = explode('/', $sQuery);
|
||||
$aPhrases = array_reverse($aPhrases);
|
||||
$sQuery = join(', ',$aPhrases);
|
||||
$oGeocode->setQuery($sQuery);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oGeocode->setQueryFromParams($_GET);
|
||||
$oGeocode->setQueryFromParams($_GET);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +116,12 @@
|
||||
$aSearchResults = $oGeocode->lookup();
|
||||
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));
|
||||
|
||||
$bAsText = $oGeocode->getIncludePolygonAsText();
|
||||
|
||||
Reference in New Issue
Block a user