source: subversion/applications/utils/export/osm2pgsql-64/output.h @ 26020

Revision 26020, 3.0 KB checked in by frederik, 3 years ago (diff)

Branch of osm2pgsql that does not use intarray. Unsure if it works
with Postgres 8.3; does work with 8.4. Performance seems to be
identical to original; this version can be compiled with -DOSMID64
(or #define OSMID64 in osmtypes.h) to support OSM IDs larger than
a 4 byte integer. Using this option seems to increase database size
by something like 10%, and not significantly affect speed.

Not tested with Postgres 9.0; also, tire expiry and gazetteer functions
are untested (even though there's little reason to believe they should
be broken).

Line 
1/* Common output layer interface */
2
3/* Each output layer must provide methods for
4 * storing:
5 * - Nodes (Points of interest etc)
6 * - Way geometries
7 * Associated tags: name, type etc.
8*/
9
10#ifndef OUTPUT_H
11#define OUTPUT_H
12
13#include "middle.h"
14#include "keyvals.h"
15
16/* Variants for generation of hstore column */
17/* No hstore column */
18#define HSTORE_NONE 0
19/* create a hstore column for all tags which do not have an exclusive column */
20#define HSTORE_NORM 1
21/* create a hstore column for all tags */
22#define HSTORE_ALL 2
23
24struct output_options {
25  const char *conninfo;  /* Connection info string */
26  const char *prefix;    /* prefix for table names */
27  int scale;       /* scale for converting coordinates to fixed point */
28  int projection;  /* SRS of projection */
29  int append;      /* Append to existing data */
30  int slim;        /* In slim mode */
31  int cache;       /* Memory usable for cache in MB */
32  struct middle_t *mid;  /* Mid storage to use */
33  const char *tblsmain_index;     /* Pg Tablespace to store indexes on main tables */
34  const char *tblsslim_index;     /* Pg Tablespace to store indexes on slim tables */
35  const char *tblsmain_data;     /* Pg Tablespace to store main tables */
36  const char *tblsslim_data;     /* Pg Tablespace to store slim tables */
37  const char *style;     /* style file to use */
38  int expire_tiles_zoom;        /* Zoom level for tile expiry list */
39  int expire_tiles_zoom_min;    /* Minimum zoom level for tile expiry list */
40  const char *expire_tiles_filename;    /* File name to output expired tiles list to */
41  int enable_hstore; /* add an additional hstore column with objects key/value pairs */
42  int enable_multi; /* Output multi-geometries intead of several simple geometries */
43  const char** hstore_columns; /* list of columns that should be written into their own hstore column */
44  int n_hstore_columns; /* number of hstore columns */
45  int keep_coastlines;
46};
47
48struct output_t {
49    int (*start)(const struct output_options *options);
50    void (*stop)();
51    void (*cleanup)(void);
52//    void (*process)(struct middle_t *mid);
53//    int (*node)(osmid_t id, struct keyval *tags, double node_lat, double node_lon);
54//    int (*way)(osmid_t id, struct keyval *tags, struct osmNode *nodes, int count);
55//    int (*relation)(osmid_t id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
56
57    int (*node_add)(osmid_t id, double lat, double lon, struct keyval *tags);
58    int (*way_add)(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
59    int (*relation_add)(osmid_t id, struct member *members, int member_count, struct keyval *tags);
60
61    int (*node_modify)(osmid_t id, double lat, double lon, struct keyval *tags);
62    int (*way_modify)(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
63    int (*relation_modify)(osmid_t id, struct member *members, int member_count, struct keyval *tags);
64
65    int (*node_delete)(osmid_t id);
66    int (*way_delete)(osmid_t id);
67    int (*relation_delete)(osmid_t id);
68};
69
70unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
71
72#endif
Note: See TracBrowser for help on using the repository browser.