From f1c905e60f326e2280967e8ce9de01e351e88b53 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 23 May 2011 21:51:59 +0200 Subject: [PATCH] bbox reader --- tools/osmpbf-outline.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/osmpbf-outline.cpp b/tools/osmpbf-outline.cpp index 2373b00..5d3d00a 100644 --- a/tools/osmpbf-outline.cpp +++ b/tools/osmpbf-outline.cpp @@ -22,6 +22,9 @@ const int MAX_BLOB_HEADER_SIZE = 64 * 1024; // the maximum size of a blob in bytes const int MAX_BLOB_SIZE = 32 * 1024 * 1024; +// nanodegree multiplier +static const long int NANO = 1000 * 1000 * 1000; + // buffer for reading a compressed blob from file char buffer[MAX_BLOB_SIZE]; @@ -239,6 +242,14 @@ int main(int argc, char *argv[]) { // parse the OSMHeader from the blob osmheader.ParseFromArray(unpack_buffer, sz); + // tell about the bbox + if(osmheader.has_bbox()) { + OSMPBF::HeaderBBox bbox = osmheader.bbox(); + debug(" bbox: %.7f,%.7f,%.7f,%.7f", + (double)bbox.left() / NANO, (double)bbox.bottom() / NANO, + (double)bbox.right() / NANO, (double)bbox.top() / NANO); + } + // tell about the required features for(int i = 0, l = osmheader.required_features_size(); i < l; i++) debug(" required_feature: %s", osmheader.required_features(i).c_str());