]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / utils / setup.php
index f8da1970e73eb2448b2f8969290609a8eaf2ea25..6dc8772499d7fb06db99b578aab4671cf890959c 100755 (executable)
                pgsqlRunScriptFile(CONST_BasePath.'/data/us_statecounty.sql');
                pgsqlRunScriptFile(CONST_BasePath.'/data/us_state.sql');
                pgsqlRunScriptFile(CONST_BasePath.'/data/us_postcode.sql');
-               pgsqlRunScriptFile(CONST_BasePath.'/data/worldboundaries.sql');
        }
 
        if ($aCMDResult['import-data'] || $aCMDResult['all'])
                }
 
                // 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)
-               $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);
                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);