From 5167802ba9e30f17ea71e0783c475764fdb8ec64 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Tue, 13 May 2014 15:43:13 +0200 Subject: Use sqlite db file instead of text *.lst files for selected data. This changes the way some data is given from one taginfo update run to the next. Instead of plain text files an sqlite database is used. Part of the update is a new version of the upstream sqlite.hpp file. After this commit the update has to be run twice to get all data updated properly. --- tagstats/osmstats.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'tagstats/osmstats.cpp') diff --git a/tagstats/osmstats.cpp b/tagstats/osmstats.cpp index bfd757d..cb4cc93 100644 --- a/tagstats/osmstats.cpp +++ b/tagstats/osmstats.cpp @@ -37,17 +37,8 @@ int main(int argc, char *argv[]) { Osmium::OSMFile infile(argv[1]); - Sqlite::Database db(argv[2]); - sqlite3* sqlite_db = db.get_sqlite3(); - if (SQLITE_OK != sqlite3_exec(sqlite_db, \ - "CREATE TABLE stats (" \ - " key TEXT, " \ - " value INT64 " \ - ");", 0, 0, 0)) { - std::cerr << "Database error: " << sqlite3_errmsg(sqlite_db) << "\n"; - sqlite3_close(sqlite_db); - exit(1); - } + Sqlite::Database db(argv[2], SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE); + db.exec("CREATE TABLE stats (key TEXT, value INT64);"); StatisticsHandler handler(db); Osmium::Input::read(infile, handler); -- cgit v1.2.3