forked from hans/Nominatim
switch from osmosis to pyosmium for updates
Pyosmium comes with convenient functions for finding the right state and does not require external files for rembering the state. Updates can now conveniently set up by simply running ./utils/update.php --init-updates and state is kept directly in the import_status table. This change requires an update in the database schema. Run the following to update: ALTER TABLE import_status ADD COLUMN sequence_id integer; ALTER TABLE import_status ADD COLUMN indexed boolean; ALTER TABLE import_osmosis_log ADD COLUMN batchseq integer;
This commit is contained in:
12
lib/lib.php
12
lib/lib.php
@@ -33,6 +33,18 @@ function getCacheMemoryMB()
|
||||
return (int)($aMatches[1]/1024);
|
||||
}
|
||||
|
||||
function getDatabaseDate(&$oDB)
|
||||
{
|
||||
// Find the newest node in the DB
|
||||
$iLastOSMID = $oDB->getOne("select max(osm_id) from place where osm_type = 'N'");
|
||||
// Lookup the timestamp that node was created
|
||||
$sLastNodeURL = 'http://www.openstreetmap.org/api/0.6/node/'.$iLastOSMID."/1";
|
||||
$sLastNodeXML = file_get_contents($sLastNodeURL);
|
||||
preg_match('#timestamp="(([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z)"#', $sLastNodeXML, $aLastNodeDate);
|
||||
|
||||
return $aLastNodeDate[1];
|
||||
}
|
||||
|
||||
|
||||
function bySearchRank($a, $b)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user