File: output.h

package info (click to toggle)
osm2pgsql 0.69%2Br20104-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 61,864 kB
  • ctags: 1,421
  • sloc: sql: 98,888; ansic: 6,609; php: 2,452; sh: 580; cpp: 527; makefile: 138
file content (56 lines) | stat: -rw-r--r-- 2,218 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* Common output layer interface */

/* Each output layer must provide methods for 
 * storing:
 * - Nodes (Points of interest etc)
 * - Way geometries
 * Associated tags: name, type etc. 
*/

#ifndef OUTPUT_H
#define OUTPUT_H

#include "middle.h"
#include "keyvals.h"

struct output_options {
  const char *conninfo;  /* Connection info string */
  const char *prefix;    /* prefix for table names */
  int scale;       /* scale for converting coordinates to fixed point */
  int projection;  /* SRS of projection */
  int append;      /* Append to existing data */
  int slim;        /* In slim mode */
  int cache;       /* Memory usable for cache in MB */
  struct middle_t *mid;  /* Mid storage to use */
  const char *style;     /* style file to use */
  int expire_tiles_zoom;	/* Zoom level for tile expiry list */
  int expire_tiles_zoom_min;	/* Minimum zoom level for tile expiry list */
  const char *expire_tiles_filename;	/* File name to output expired tiles list to */
  int enable_multi; /* Output multi-geometries intead of several simple geometries */
};

struct output_t {
    int (*start)(const struct output_options *options);
    void (*stop)();
    void (*cleanup)(void);
//    void (*process)(struct middle_t *mid);
//    int (*node)(int id, struct keyval *tags, double node_lat, double node_lon);
//    int (*way)(int id, struct keyval *tags, struct osmNode *nodes, int count);
//    int (*relation)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);

    int (*node_add)(int id, double lat, double lon, struct keyval *tags);
    int (*way_add)(int id, int *nodes, int node_count, struct keyval *tags);
    int (*relation_add)(int id, struct member *members, int member_count, struct keyval *tags);

    int (*node_modify)(int id, double lat, double lon, struct keyval *tags);
    int (*way_modify)(int id, int *nodes, int node_count, struct keyval *tags);
    int (*relation_modify)(int id, struct member *members, int member_count, struct keyval *tags);

    int (*node_delete)(int id);
    int (*way_delete)(int id);
    int (*relation_delete)(int id);
};

unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);

#endif