source: subversion/applications/utils/export/osm2pgsql/output.h @ 24605

Revision 24605, 2.5 KB checked in by jonb, 3 years ago (diff)

osm2pgsql: Add command line switch to include natural=coastline ways in the database. Based on patch from Dane Springmeyer. Closes #3350

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
16struct output_options {
17  const char *conninfo;  /* Connection info string */
18  const char *prefix;    /* prefix for table names */
19  int scale;       /* scale for converting coordinates to fixed point */
20  int projection;  /* SRS of projection */
21  int append;      /* Append to existing data */
22  int slim;        /* In slim mode */
23  int cache;       /* Memory usable for cache in MB */
24  struct middle_t *mid;  /* Mid storage to use */
25  const char *tblsindex;     /* Pg Tablespace to store indexes */
26  const char *style;     /* style file to use */
27  int expire_tiles_zoom;        /* Zoom level for tile expiry list */
28  int expire_tiles_zoom_min;    /* Minimum zoom level for tile expiry list */
29  const char *expire_tiles_filename;    /* File name to output expired tiles list to */
30  int enable_hstore; /* add an additional hstore column with objects key/value pairs */
31  int enable_multi; /* Output multi-geometries intead of several simple geometries */
32  const char** hstore_columns; /* list of columns that should be written into their own hstore column */
33  int n_hstore_columns; /* number of hstore columns */
34  int keep_coastlines;
35};
36
37struct output_t {
38    int (*start)(const struct output_options *options);
39    void (*stop)();
40    void (*cleanup)(void);
41//    void (*process)(struct middle_t *mid);
42//    int (*node)(int id, struct keyval *tags, double node_lat, double node_lon);
43//    int (*way)(int id, struct keyval *tags, struct osmNode *nodes, int count);
44//    int (*relation)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
45
46    int (*node_add)(int id, double lat, double lon, struct keyval *tags);
47    int (*way_add)(int id, int *nodes, int node_count, struct keyval *tags);
48    int (*relation_add)(int id, struct member *members, int member_count, struct keyval *tags);
49
50    int (*node_modify)(int id, double lat, double lon, struct keyval *tags);
51    int (*way_modify)(int id, int *nodes, int node_count, struct keyval *tags);
52    int (*relation_modify)(int id, struct member *members, int member_count, struct keyval *tags);
53
54    int (*node_delete)(int id);
55    int (*way_delete)(int id);
56    int (*relation_delete)(int id);
57};
58
59unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
60
61#endif
Note: See TracBrowser for help on using the repository browser.