Osmium  0.1
include/osmium/handler/find_bbox.hpp
Go to the documentation of this file.
00001 #ifndef OSMIUM_HANDLER_FIND_BBOX_HPP
00002 #define OSMIUM_HANDLER_FIND_BBOX_HPP
00003 
00004 /*
00005 
00006 Copyright 2011 Jochen Topf <jochen@topf.org> and others (see README).
00007 
00008 This file is part of Osmium (https://github.com/joto/osmium).
00009 
00010 Osmium is free software: you can redistribute it and/or modify it under the
00011 terms of the GNU Lesser General Public License or (at your option) the GNU
00012 General Public License as published by the Free Software Foundation, either
00013 version 3 of the Licenses, or (at your option) any later version.
00014 
00015 Osmium is distributed in the hope that it will be useful, but WITHOUT ANY
00016 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00017 PARTICULAR PURPOSE. See the GNU Lesser General Public License and the GNU
00018 General Public License for more details.
00019 
00020 You should have received a copy of the Licenses along with Osmium. If not, see
00021 <http://www.gnu.org/licenses/>.
00022 
00023 */
00024 
00025 #include <osmium/handler.hpp>
00026 #include <osmium/osm/bounds.hpp>
00027 
00028 namespace Osmium {
00029 
00030     namespace Handler {
00031 
00032         class FindBbox : public Base {
00033 
00034         public:
00035 
00036             FindBbox() : Base(), m_bounds() {
00037             }
00038 
00039             const Osmium::OSM::Bounds bounds() const {
00040                 return m_bounds;
00041             }
00042 
00043             void node(const shared_ptr<Osmium::OSM::Node const>& node) {
00044                 m_bounds.extend(node->position());
00045             }
00046 
00047             void after_nodes() const {
00048                 throw Osmium::Input::StopReading();
00049             }
00050 
00051         private:
00052 
00053             Osmium::OSM::Bounds m_bounds;
00054 
00055         }; // class FindBbox
00056 
00057     } // namespace Handler
00058 
00059 } // namespace Osmium
00060 
00061 #endif // OSMIUM_HANDLER_FIND_BBOX_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines