forked from hans/Nominatim
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b51efd876f | ||
|
|
405279dae3 | ||
|
|
3dd223dfa3 | ||
|
|
7e6125ada5 | ||
|
|
93b72e4e9b | ||
|
|
3bf57e6d2a |
8
.github/workflows/ci-tests.yml
vendored
8
.github/workflows/ci-tests.yml
vendored
@@ -146,7 +146,7 @@ jobs:
|
||||
run: nominatim special-phrases --import-from-wiki
|
||||
working-directory: data-env
|
||||
|
||||
- name: Check import
|
||||
- name: Check full import
|
||||
run: nominatim admin --check-database
|
||||
working-directory: data-env
|
||||
|
||||
@@ -161,7 +161,11 @@ jobs:
|
||||
working-directory: data-env
|
||||
|
||||
- name: Run reverse-only import
|
||||
run : nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only
|
||||
run : nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only --no-updates
|
||||
working-directory: data-env
|
||||
env:
|
||||
NOMINATIM_DATABASE_DSN: pgsql:dbname=reverse
|
||||
|
||||
- name: Check reverse import
|
||||
run: nominatim admin --check-database
|
||||
working-directory: data-env
|
||||
|
||||
@@ -20,7 +20,7 @@ project(nominatim)
|
||||
|
||||
set(NOMINATIM_VERSION_MAJOR 3)
|
||||
set(NOMINATIM_VERSION_MINOR 7)
|
||||
set(NOMINATIM_VERSION_PATCH 1)
|
||||
set(NOMINATIM_VERSION_PATCH 2)
|
||||
|
||||
set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}.${NOMINATIM_VERSION_PATCH}")
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
3.7.2
|
||||
|
||||
* fix database check for reverse-only imports
|
||||
* do not error out in status API result when import date is missing
|
||||
* add array_key_last function for PHP < 7.3 (thanks to @woodpack)
|
||||
* fix more url when server name is unknown (thanks to @mogita)
|
||||
* commit changes to replication log table
|
||||
|
||||
3.7.1
|
||||
|
||||
* fix smaller issues with special phrases import
|
||||
|
||||
@@ -51,7 +51,7 @@ class Status
|
||||
$iDataDateEpoch = $this->oDB->getOne($sSQL);
|
||||
|
||||
if ($iDataDateEpoch === false) {
|
||||
throw Exception('Data date query failed '.$iDataDateEpoch->getMessage(), 705);
|
||||
throw new Exception('Import date is not available', 705);
|
||||
}
|
||||
|
||||
return $iDataDateEpoch;
|
||||
|
||||
@@ -227,3 +227,10 @@ function closestHouseNumber($aRow)
|
||||
|
||||
return max(min($aRow['endnumber'], $iHn), $aRow['startnumber']);
|
||||
}
|
||||
|
||||
if (!function_exists('array_key_last')) {
|
||||
function array_key_last(array $array)
|
||||
{
|
||||
if (!empty($array)) return key(array_slice($array, -1, 1, true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ if (isset($_SERVER['REQUEST_SCHEME'])
|
||||
.$_SERVER['HTTP_HOST'].$_SERVER['DOCUMENT_URI'].'/?'
|
||||
.http_build_query($aMoreParams);
|
||||
} else {
|
||||
$sMoreURL = '/search.php'.http_build_query($aMoreParams);
|
||||
$sMoreURL = '/search.php?'.http_build_query($aMoreParams);
|
||||
}
|
||||
|
||||
if (CONST_Debug) exit;
|
||||
|
||||
@@ -17,6 +17,23 @@ if ($sOutputFormat == 'json') {
|
||||
try {
|
||||
$oStatus = new Nominatim\Status($oDB);
|
||||
$oStatus->status();
|
||||
|
||||
if ($sOutputFormat == 'json') {
|
||||
$epoch = $oStatus->dataDate();
|
||||
$aResponse = array(
|
||||
'status' => 0,
|
||||
'message' => 'OK',
|
||||
'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
|
||||
'software_version' => CONST_NominatimVersion
|
||||
);
|
||||
$sDatabaseVersion = $oStatus->databaseVersion();
|
||||
if ($sDatabaseVersion) {
|
||||
$aResponse['database_version'] = $sDatabaseVersion;
|
||||
}
|
||||
javascript_renderData($aResponse);
|
||||
} else {
|
||||
echo 'OK';
|
||||
}
|
||||
} catch (Exception $oErr) {
|
||||
if ($sOutputFormat == 'json') {
|
||||
$aResponse = array(
|
||||
@@ -28,25 +45,4 @@ try {
|
||||
header('HTTP/1.0 500 Internal Server Error');
|
||||
echo 'ERROR: '.$oErr->getMessage();
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($sOutputFormat == 'json') {
|
||||
$epoch = $oStatus->dataDate();
|
||||
$aResponse = array(
|
||||
'status' => 0,
|
||||
'message' => 'OK',
|
||||
'data_updated' => (new DateTime('@'.$epoch))->format(DateTime::RFC3339),
|
||||
'software_version' => CONST_NominatimVersion
|
||||
);
|
||||
$sDatabaseVersion = $oStatus->databaseVersion();
|
||||
if ($sDatabaseVersion) {
|
||||
$aResponse['database_version'] = $sDatabaseVersion;
|
||||
}
|
||||
javascript_renderData($aResponse);
|
||||
} else {
|
||||
echo 'OK';
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
@@ -114,6 +114,7 @@ class UpdateReplication:
|
||||
if state is not replication.UpdateState.NO_CHANGES:
|
||||
status.log_status(conn, start, 'import')
|
||||
batchdate, _, _ = status.get_status(conn)
|
||||
conn.commit()
|
||||
|
||||
if state is not replication.UpdateState.NO_CHANGES and args.do_index:
|
||||
index_start = dt.datetime.now(dt.timezone.utc)
|
||||
@@ -125,6 +126,7 @@ class UpdateReplication:
|
||||
with connect(args.config.get_libpq_dsn()) as conn:
|
||||
status.set_indexed(conn, True)
|
||||
status.log_status(conn, index_start, 'index')
|
||||
conn.commit()
|
||||
else:
|
||||
index_start = None
|
||||
|
||||
|
||||
@@ -94,6 +94,9 @@ def _get_indexes(conn):
|
||||
indexes.extend(('idx_search_name_nameaddress_vector',
|
||||
'idx_search_name_name_vector',
|
||||
'idx_search_name_centroid'))
|
||||
if conn.server_version_tuple() >= (11, 0, 0):
|
||||
indexes.extend(('idx_placex_housenumber',
|
||||
'idx_osmline_parent_osm_id_with_hnr'))
|
||||
if conn.table_exists('place'):
|
||||
indexes.extend(('idx_placex_pendingsector',
|
||||
'idx_location_area_country_place_id',
|
||||
|
||||
Reference in New Issue
Block a user