Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ELEMENTINSERTION_H_
00009 #define ELEMENTINSERTION_H_
00010
00011 #include "OsmDatabase.h"
00012 #include "ElementImporter.h"
00013
00014 namespace osmdb
00015 {
00016
00021 class ElementInsertion : public ElementImporter
00022 {
00023 public:
00028 ElementInsertion(OsmDatabase& db);
00029 virtual ~ElementInsertion();
00034 void insert_node(osm::Node const& nd);
00039 void insert_way(osm::Way const& w);
00044 void insert_relation(osm::Relation const& rel);
00045
00046 void insert_member_node(int64_t rel_id, std::string const& role, int64_t node_id);
00047 void insert_member_way(int64_t rel_id, std::string const& role, int64_t way_id);
00048 void insert_member_relation(int64_t parent_id, std::string const& role, int64_t child_id);
00049 private:
00050 OsmDatabase& db;
00051 psql::Statement<psql::BindTypes<int64_t, double, double>, psql::RetTypes<> > node_ins;
00052 psql::Statement<psql::BindTypes<int64_t, int64_t, int64_t, int>, psql::RetTypes<> > edge_ins;
00053 psql::Statement<psql::BindTypes<int64_t, int64_t, int>, psql::RetTypes<> > waynode_ins;
00054 psql::Statement<psql::BindTypes<int64_t>, psql::RetTypes<> > way_ins;
00055 psql::Statement<psql::BindTypes<int64_t, std::string, std::string>, psql::RetTypes<> > node_attrs_ins;
00056 psql::Statement<psql::BindTypes<int64_t, std::string, std::string>, psql::RetTypes<> > way_attrs_ins;
00057 psql::Statement<psql::BindTypes<int64_t, std::string, std::string>, psql::RetTypes<> > rel_attrs_ins;
00058 psql::Statement<psql::BindTypes<int64_t>, psql::RetTypes<> > rel_ins;
00059 psql::Statement<psql::BindTypes<int64_t, std::string, int64_t>, psql::RetTypes<> > node_mem_ins;
00060 psql::Statement<psql::BindTypes<int64_t, std::string, int64_t>, psql::RetTypes<> > way_mem_ins;
00061 psql::Statement<psql::BindTypes<int64_t, std::string, int64_t>, psql::RetTypes<> > rel_mem_ins;
00062
00063 };
00064
00065 }
00066 #endif