forked from osm2pgsql-dev/osm2pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse-osmium.hpp
59 lines (51 loc) · 1.94 KB
/
parse-osmium.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
#-----------------------------------------------------------------------------
# osm2pgsql - converts planet.osm file into PostgreSQL
# compatible output suitable to be rendered by mapnik
#-----------------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#-----------------------------------------------------------------------------
*/
#ifndef PARSE_OSMIUM_H
#define PARSE_OSMIUM_H
#include "config.h"
#include <osmium/handler.hpp>
#include "parse.hpp"
struct reprojection;
class osmdata_t;
namespace osmium {
class TagList;
class NodeRefList;
class RelationMemberList;
}
class parse_osmium_t: public parse_t, public osmium::handler::Handler
{
public:
parse_osmium_t(const std::string &fmt, int extra_attrs,
const bbox_t &bbox, const reprojection *proj, bool do_append);
void stream_file(const std::string &filename, osmdata_t *osmdata) override;
void node(osmium::Node& node);
void way(osmium::Way& way);
void relation(osmium::Relation& rel);
private:
void convert_tags(const osmium::OSMObject &obj);
void convert_nodes(const osmium::NodeRefList &in_nodes);
void convert_members(const osmium::RelationMemberList &in_rels);
osmdata_t *data;
std::string format;
bool append;
};
#endif