Skip to content

Commit

Permalink
Get timestamp from OsmPbfReader, with osmium
Browse files Browse the repository at this point in the history
  • Loading branch information
jocelynj committed Dec 28, 2020
1 parent 52e7fd4 commit 7b6bfe5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/OsmOsisManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,11 @@ def update_metainfo(self, conf):
gisconn = self.osmosis().conn()
giscurs = gisconn.cursor()

try:
diff_path = conf.download["diff_path"]
osm_state = OsmState(os.path.join(diff_path, "state.txt")).timestamp()
except:
from modules.OsmPbf import OsmPbfReader
osm_state = OsmPbfReader(conf.download["dst"], None).timestamp()
diff_path = conf.download["diff_path"]
state_file = os.path.join(diff_path, "state.txt")

from modules.OsmPbf import OsmPbfReader
osm_state = OsmPbfReader(conf.download["dst"], state_file=state_file).timestamp()

giscurs.execute("UPDATE metainfo SET tstamp = %s", [osm_state])

Expand Down

0 comments on commit 7b6bfe5

Please sign in to comment.