Store metadata about original OSM data, and return it in the API response, if available.

This commit is contained in:
Lev Dragunov
2019-01-15 13:18:20 +03:00
committed by Daniel Patterson
parent 4c665b24d9
commit 8b45ff7a18
17 changed files with 104 additions and 5 deletions
+9
View File
@@ -51,6 +51,7 @@
#include <osmium/handler/node_locations_for_ways.hpp>
#include <osmium/index/map/flex_mem.hpp>
#include <osmium/io/any_input.hpp>
#include <osmium/osm/timestamp.hpp>
#include <osmium/thread/pool.hpp>
#include <osmium/visitor.hpp>
@@ -425,6 +426,14 @@ Extractor::ParseOSMData(ScriptingEnvironment &scripting_environment,
// write .timestamp data file
std::string timestamp = header.get("osmosis_replication_timestamp");
if (config.data_version == "osmosis")
{
files::writeTimestamp(config.GetPath(".osrm.timestamp").string(), timestamp);
}
else
{
files::writeTimestamp(config.GetPath(".osrm.timestamp").string(), config.data_version);
}
if (timestamp.empty())
{
timestamp = "n/a";