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

Last change on this file since 24605 was 24605, checked in by jonb, 8 years ago

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

File size: 2.5 KB
RevLine 
[2309]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
[13612]13#include "middle.h"
[2309]14#include "keyvals.h"
15
[7331]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 */
[7345]23  int cache;       /* Memory usable for cache in MB */
[7331]24  struct middle_t *mid;  /* Mid storage to use */
[21630]25  const char *tblsindex;     /* Pg Tablespace to store indexes */
[10338]26  const char *style;     /* style file to use */
[13612]27  int expire_tiles_zoom;        /* Zoom level for tile expiry list */
[13668]28  int expire_tiles_zoom_min;    /* Minimum zoom level for tile expiry list */
[13612]29  const char *expire_tiles_filename;    /* File name to output expired tiles list to */
[20475]30  int enable_hstore; /* add an additional hstore column with objects key/value pairs */
[19148]31  int enable_multi; /* Output multi-geometries intead of several simple geometries */
[23440]32  const char** hstore_columns; /* list of columns that should be written into their own hstore column */
[22371]33  int n_hstore_columns; /* number of hstore columns */
[24605]34  int keep_coastlines;
[7331]35};
36
[2309]37struct output_t {
[7331]38    int (*start)(const struct output_options *options);
39    void (*stop)();
[2309]40    void (*cleanup)(void);
[7331]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);
[8863]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);
[2309]57};
58
[7331]59unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
[4917]60
[2309]61#endif
Note: See TracBrowser for help on using the repository browser.