forked from osm2pgsql-dev/osm2pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.h
60 lines (50 loc) · 2.47 KB
/
output.h
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
/* Common output layer interface */
/* Each output layer must provide methods for
* storing:
* - Nodes (Points of interest etc)
* - Way geometries
* Associated tags: name, type etc.
*/
#ifndef OUTPUT_H
#define OUTPUT_H
#include "middle.h"
#include "keyvals.h"
struct output_options {
const char *conninfo; /* Connection info string */
const char *prefix; /* prefix for table names */
int scale; /* scale for converting coordinates to fixed point */
int projection; /* SRS of projection */
int append; /* Append to existing data */
int slim; /* In slim mode */
int cache; /* Memory usable for cache in MB */
struct middle_t *mid; /* Mid storage to use */
const char *tblsindex; /* Pg Tablespace to store indexes */
const char *style; /* style file to use */
int expire_tiles_zoom; /* Zoom level for tile expiry list */
int expire_tiles_zoom_min; /* Minimum zoom level for tile expiry list */
const char *expire_tiles_filename; /* File name to output expired tiles list to */
int enable_hstore; /* add an additional hstore column with objects key/value pairs */
int enable_multi; /* Output multi-geometries intead of several simple geometries */
const char** hstore_columns; /* list of columns that should be written into their own hstore column */
int n_hstore_columns; /* number of hstore columns */
};
struct output_t {
int (*start)(const struct output_options *options);
void (*stop)();
void (*cleanup)(void);
// void (*process)(struct middle_t *mid);
// int (*node)(int id, struct keyval *tags, double node_lat, double node_lon);
// int (*way)(int id, struct keyval *tags, struct osmNode *nodes, int count);
// int (*relation)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
int (*node_add)(int id, double lat, double lon, struct keyval *tags);
int (*way_add)(int id, int *nodes, int node_count, struct keyval *tags);
int (*relation_add)(int id, struct member *members, int member_count, struct keyval *tags);
int (*node_modify)(int id, double lat, double lon, struct keyval *tags);
int (*way_modify)(int id, int *nodes, int node_count, struct keyval *tags);
int (*relation_modify)(int id, struct member *members, int member_count, struct keyval *tags);
int (*node_delete)(int id);
int (*way_delete)(int id);
int (*relation_delete)(int id);
};
unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
#endif