mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
make osmosis-init also work for older planets
Use planet_osm_nodes instead of places to get the very last node even if it is untagged. Then ask for version 1 to avoid being mislead if the node has been changed in the meantime.
This commit is contained in:
@@ -513,10 +513,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find the last node in the DB
|
// Find the last node in the DB
|
||||||
$iLastOSMID = $oDB->getOne("select max(osm_id) as osm_id from place where osm_type = 'N'");
|
$iLastOSMID = $oDB->getOne("select max(id) from planet_osm_nodes");
|
||||||
|
|
||||||
// Lookup the timestamp that node was created (less 3 hours for margin for changsets to be closed)
|
// Lookup the timestamp that node was created (less 3 hours for margin for changsets to be closed)
|
||||||
$sLastNodeURL = 'http://www.openstreetmap.org/api/0.6/node/'.$iLastOSMID;
|
$sLastNodeURL = 'http://www.openstreetmap.org/api/0.6/node/'.$iLastOSMID."/1";
|
||||||
$sLastNodeXML = file_get_contents($sLastNodeURL);
|
$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);
|
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);
|
||||||
$iLastNodeTimestamp = strtotime($aLastNodeDate[1]) - (3*60*60);
|
$iLastNodeTimestamp = strtotime($aLastNodeDate[1]) - (3*60*60);
|
||||||
|
|||||||
Reference in New Issue
Block a user