[osmium-tool] 12/97: Also report number of changesets for fileinfo -e.
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Tue Jul 21 20:15:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to tag v1.0.0
in repository osmium-tool.
commit 2ff8fdb402c5fd93756e4cef48ee8ab263536a0e
Author: Jochen Topf <jochen at topf.org>
Date: Thu Jul 3 10:18:36 2014 +0200
Also report number of changesets for fileinfo -e.
---
src/command_fileinfo.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/command_fileinfo.cpp b/src/command_fileinfo.cpp
index e54096f..8d9349d 100644
--- a/src/command_fileinfo.cpp
+++ b/src/command_fileinfo.cpp
@@ -91,6 +91,7 @@ bool CommandFileinfo::setup(const std::vector<std::string>& arguments) {
struct InfoHandler : public osmium::handler::Handler {
osmium::Box bounds;
+ uint64_t changesets = 0;
uint64_t nodes = 0;
uint64_t ways = 0;
uint64_t relations = 0;
@@ -98,6 +99,11 @@ struct InfoHandler : public osmium::handler::Handler {
osmium::Timestamp last_timestamp = osmium::start_of_time();
CryptoPP::SHA hash {};
+ void changeset(const osmium::Changeset& changeset) {
+ hash.Update(changeset.data(), changeset.byte_size());
+ ++changesets;
+ }
+
void osm_object(const osmium::OSMObject& object) {
if (object.timestamp() < first_timestamp) {
first_timestamp = object.timestamp();
@@ -163,6 +169,7 @@ bool CommandFileinfo::run() {
if (m_extended) {
InfoHandler info_handler;
+
osmium::apply(reader, info_handler);
std::cout << "Data: " << "\n";
std::cout << " Bounding box: " << info_handler.bounds << "\n";
@@ -176,6 +183,7 @@ bool CommandFileinfo::run() {
std::cout << static_cast<int>(digest[i]);
}
std::cout << std::dec << "\n";
+ std::cout << " Number of changesets: " << info_handler.changesets << "\n";
std::cout << " Number of nodes: " << info_handler.nodes << "\n";
std::cout << " Number of ways: " << info_handler.ways << "\n";
std::cout << " Number of relations: " << info_handler.relations << "\n";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmium-tool.git
More information about the Pkg-grass-devel
mailing list