Osmium
0.1
|
#include <input.hpp>
Public Member Functions | |
virtual | ~Base () |
virtual void | parse ()=0 |
Protected Member Functions | |
Base (Osmium::OSMFile &file, THandler &handler) | |
void | call_after_and_before_on_handler (osm_object_type_t current_object_type) |
void | call_node_on_handler () const |
void | call_way_on_handler () const |
void | call_relation_on_handler () const |
void | call_final_on_handler () const |
Osmium::OSM::Meta & | meta () |
int | get_fd () const |
const Osmium::OSMFile & | get_file () const |
Osmium::OSM::Node & | prepare_node () |
Osmium::OSM::Way & | prepare_way () |
Osmium::OSM::Relation & | prepare_relation () |
Protected Attributes | |
shared_ptr< Osmium::OSM::Node > | m_node |
shared_ptr< Osmium::OSM::Way > | m_way |
shared_ptr< Osmium::OSM::Relation > | m_relation |
Private Attributes | |
osm_object_type_t | m_last_object_type |
Osmium::OSMFile | m_file |
THandler & | m_handler |
Osmium::OSM::Meta | m_meta |
Virtual base class for all input classes.
The THandler template parameter of this class (and child classes) names a policy class on which methods will be called. The class should implement one or more of the following functions:
init() will be called before all others, final() after all others.
For every object node(), way(), or relation() will be called, respectively.
When there are several objects of the same type in a row the before_*() function will be called before them and the after_*() function after them. If your input file is sorted as OSM files normally are, i.e. all nodes, then all ways, then all relations, this will call before_nodes() once, then for all the nodes node(), then after_nodes(), then before_ways(), and so on. This will also work properly if the input file contains, say, first all relations, than all ways and then all nodes.
But if you have nodes, ways, and relations intermixed in an input file these handlers will probably not called in a useful way for you. You can use osmosis --sort to sort your input file first.
The method area() is special. It will only be called if you have the multipolygon handler before your handler. There are no before/after_areas() methods. Use init() and final() instead.
virtual Osmium::Input::Base< THandler >::~Base | ( | ) | [inline, virtual] |
Osmium::Input::Base< THandler >::Base | ( | Osmium::OSMFile & | file, |
THandler & | handler | ||
) | [inline, protected] |
void Osmium::Input::Base< THandler >::call_after_and_before_on_handler | ( | osm_object_type_t | current_object_type | ) | [inline, protected] |
void Osmium::Input::Base< THandler >::call_final_on_handler | ( | ) | const [inline, protected] |
void Osmium::Input::Base< THandler >::call_node_on_handler | ( | ) | const [inline, protected] |
void Osmium::Input::Base< THandler >::call_relation_on_handler | ( | ) | const [inline, protected] |
void Osmium::Input::Base< THandler >::call_way_on_handler | ( | ) | const [inline, protected] |
int Osmium::Input::Base< THandler >::get_fd | ( | ) | const [inline, protected] |
const Osmium::OSMFile& Osmium::Input::Base< THandler >::get_file | ( | ) | const [inline, protected] |
Osmium::OSM::Meta& Osmium::Input::Base< THandler >::meta | ( | ) | [inline, protected] |
virtual void Osmium::Input::Base< THandler >::parse | ( | ) | [pure virtual] |
Parse an OSM input file. This is a pure virtual function, it must be overwritten in a child class of Osmium::Input::Base.
Implemented in Osmium::Input::PBF< THandler >, and Osmium::Input::XML< THandler >.
Osmium::OSM::Node& Osmium::Input::Base< THandler >::prepare_node | ( | ) | [inline, protected] |
Osmium::OSM::Relation& Osmium::Input::Base< THandler >::prepare_relation | ( | ) | [inline, protected] |
Osmium::OSM::Way& Osmium::Input::Base< THandler >::prepare_way | ( | ) | [inline, protected] |
Osmium::OSMFile Osmium::Input::Base< THandler >::m_file [private] |
The OSMFile we opened this file with.
THandler& Osmium::Input::Base< THandler >::m_handler [private] |
Handler we will call callbacks on.
osm_object_type_t Osmium::Input::Base< THandler >::m_last_object_type [private] |
The last object type we read (before the current one). Used to properly call before and after methods.
Osmium::OSM::Meta Osmium::Input::Base< THandler >::m_meta [private] |
shared_ptr<Osmium::OSM::Node> Osmium::Input::Base< THandler >::m_node [protected] |
shared_ptr<Osmium::OSM::Relation> Osmium::Input::Base< THandler >::m_relation [protected] |
shared_ptr<Osmium::OSM::Way> Osmium::Input::Base< THandler >::m_way [protected] |