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

Last change on this file since 9252 was 8863, checked in by martinvoosterhout, 12 years ago

Commit parser changes to support the loading of diffs. Supports both
osmChange and JOSM though it doesn't support placeholders (it's not clear
that's useful in this context). Anything other than creating still results
in an error so far, so it doesn't change anything from a practical point of
view yet.

In passing, fix a bug where the append option didn't work in slim mode.

File size: 1.8 KB
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 "keyvals.h"
14
15struct output_options {
16  const char *conninfo;  /* Connection info string */
17  const char *prefix;    /* prefix for table names */
18  int scale;       /* scale for converting coordinates to fixed point */
19  int projection;  /* SRS of projection */
20  int append;      /* Append to existing data */
21  int slim;        /* In slim mode */
22  int cache;       /* Memory usable for cache in MB */
23  struct middle_t *mid;  /* Mid storage to use */
24};
25
26struct output_t {
27    int (*start)(const struct output_options *options);
28    void (*stop)();
29    void (*cleanup)(void);
30//    void (*process)(struct middle_t *mid);
31//    int (*node)(int id, struct keyval *tags, double node_lat, double node_lon);
32//    int (*way)(int id, struct keyval *tags, struct osmNode *nodes, int count);
33//    int (*relation)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
34
35    int (*node_add)(int id, double lat, double lon, struct keyval *tags);
36    int (*way_add)(int id, int *nodes, int node_count, struct keyval *tags);
37    int (*relation_add)(int id, struct member *members, int member_count, struct keyval *tags);
38
39    int (*node_modify)(int id, double lat, double lon, struct keyval *tags);
40    int (*way_modify)(int id, int *nodes, int node_count, struct keyval *tags);
41    int (*relation_modify)(int id, struct member *members, int member_count, struct keyval *tags);
42
43    int (*node_delete)(int id);
44    int (*way_delete)(int id);
45    int (*relation_delete)(int id);
46};
47
48unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
49
50#endif
Note: See TracBrowser for help on using the repository browser.