forked from osm2pgsql-dev/osm2pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput-gazetteer.hpp
80 lines (60 loc) · 2.82 KB
/
output-gazetteer.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef OUTPUT_GAZETTEER_H
#define OUTPUT_GAZETTEER_H
#include "output.hpp"
#include "geometry-builder.hpp"
#include "reprojection.hpp"
#include <boost/shared_ptr.hpp>
class output_gazetteer_t : public output_t {
public:
output_gazetteer_t(const middle_query_t* mid_, const options_t &options_);
output_gazetteer_t(const output_gazetteer_t& other);
virtual ~output_gazetteer_t();
virtual boost::shared_ptr<output_t> clone(const middle_query_t* cloned_middle);
int start();
middle_t::cb_func *way_callback();
middle_t::cb_func *relation_callback();
void stop();
void commit();
void enqueue_ways(pending_queue_t &job_queue, osmid_t id);
int pending_way(osmid_t id, int exists);
int node_add(osmid_t id, double lat, double lon, struct keyval *tags);
int way_add(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
int relation_add(osmid_t id, struct member *members, int member_count, struct keyval *tags);
int node_modify(osmid_t id, double lat, double lon, struct keyval *tags);
int way_modify(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
int relation_modify(osmid_t id, struct member *members, int member_count, struct keyval *tags);
int node_delete(osmid_t id);
int way_delete(osmid_t id);
int relation_delete(osmid_t id);
std::string const& name() const;
private:
static const size_t BUFFER_SIZE = 4096;
void require_slim_mode(void);
void copy_data(const char *sql);
void stop_copy(void);
void delete_unused_classes(char osm_type, osmid_t osm_id, struct keyval *places);
void add_place(char osm_type, osmid_t osm_id, const char *key_class, const char *type,
struct keyval *names, struct keyval *extratags, int adminlevel,
struct keyval *housenumber, struct keyval *street, struct keyval *addr_place,
const char *isin, struct keyval *postcode, struct keyval *countrycode,
const char *wkt);
void delete_place(char osm_type, osmid_t osm_id);
int gazetteer_process_node(osmid_t id, double lat, double lon, struct keyval *tags,
int delete_old);
int gazetteer_process_way(osmid_t id, osmid_t *ndv, int ndc, struct keyval *tags,
int delete_old);
int gazetteer_process_relation(osmid_t id, struct member *members, int member_count,
struct keyval *tags, int delete_old);
int connect();
struct pg_conn *Connection;
struct pg_conn *ConnectionDelete;
struct pg_conn *ConnectionError;
int CopyActive;
unsigned int BufferLen;
char Buffer[BUFFER_SIZE];
geometry_builder builder;
boost::shared_ptr<reprojection> reproj;
const static std::string NAME;
};
extern output_gazetteer_t out_gazetteer;
#endif