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

Last change on this file since 15536 was 13668, checked in by stevehill, 11 years ago

Replace the in-memory dirty tile store with something a bit more efficient.

Also adds support for specifying a range of zoom levels - i.e. "-o 0-17". The output dirty tile list will use the lowest zoom level which accurately describes the tiles which have been expired.

File size: 2.1 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 "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 *style;     /* style file to use */
26  int expire_tiles_zoom;        /* Zoom level for tile expiry list */
27  int expire_tiles_zoom_min;    /* Minimum zoom level for tile expiry list */
28  const char *expire_tiles_filename;    /* File name to output expired tiles list to */
29};
30
31struct output_t {
32    int (*start)(const struct output_options *options);
33    void (*stop)();
34    void (*cleanup)(void);
35//    void (*process)(struct middle_t *mid);
36//    int (*node)(int id, struct keyval *tags, double node_lat, double node_lon);
37//    int (*way)(int id, struct keyval *tags, struct osmNode *nodes, int count);
38//    int (*relation)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
39
40    int (*node_add)(int id, double lat, double lon, struct keyval *tags);
41    int (*way_add)(int id, int *nodes, int node_count, struct keyval *tags);
42    int (*relation_add)(int id, struct member *members, int member_count, struct keyval *tags);
43
44    int (*node_modify)(int id, double lat, double lon, struct keyval *tags);
45    int (*way_modify)(int id, int *nodes, int node_count, struct keyval *tags);
46    int (*relation_modify)(int id, struct member *members, int member_count, struct keyval *tags);
47
48    int (*node_delete)(int id);
49    int (*way_delete)(int id);
50    int (*relation_delete)(int id);
51};
52
53unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
54
55#endif
Note: See TracBrowser for help on using the repository browser.