source: subversion/applications/utils/export/osm2pgsql/middle.h @ 26711

Last change on this file since 26711 was 26020, checked in by frederik, 9 years ago

Branch of osm2pgsql that does not use intarray. Unsure if it works
with Postgres 8.3; does work with 8.4. Performance seems to be
identical to original; this version can be compiled with -DOSMID64
(or #define OSMID64 in osmtypes.h) to support OSM IDs larger than
a 4 byte integer. Using this option seems to increase database size
by something like 10%, and not significantly affect speed.

Not tested with Postgres 9.0; also, tire expiry and gazetteer functions
are untested (even though there's little reason to believe they should
be broken).

File size: 1.7 KB
Line 
1/* Common middle layer interface */
2
3/* Each middle layer data store must provide methods for
4 * storing and retrieving node and way data.
5 */
6
7#ifndef MIDDLE_H
8#define MIDDLE_H
9
10#include "osmtypes.h"
11
12struct keyval;
13struct member;
14struct output_options;
15
16struct middle_t {
17    int (*start)(const struct output_options *options);
18    void (*stop)(void);
19    void (*cleanup)(void);
20    void (*analyze)(void);
21    void (*end)(void);
22
23    int (*nodes_set)(osmid_t id, double lat, double lon, struct keyval *tags);
24    int (*nodes_get_list)(struct osmNode *out, osmid_t *nds, int nd_count);
25    int (*nodes_delete)(osmid_t id);
26    int (*node_changed)(osmid_t id);
27//    int (*nodes_get)(struct osmNode *out, osmid_t id);
28
29    int (*ways_set)(osmid_t id, osmid_t *nds, int nd_count, struct keyval *tags, int pending);
30    int (*ways_get)(osmid_t id, struct keyval *tag_ptr, struct osmNode **node_ptr, int *count_ptr);
31    int (*ways_done)(osmid_t id);
32    int (*ways_delete)(osmid_t id);
33    int (*way_changed)(osmid_t id);
34
35    int (*relations_set)(osmid_t id, struct member *members, int member_count, struct keyval *tags);
36//    int (*relations_get)(osmid_t id, struct member **members, int *member_count, struct keyval *tags);
37    int (*relations_done)(osmid_t id);
38    int (*relations_delete)(osmid_t id);
39    int (*relation_changed)(osmid_t id);
40
41//    void (*iterate_nodes)(int (*callback)(osmid_t id, struct keyval *tags, double node_lat, double node_lon));
42    void (*iterate_ways)(int (*callback)(osmid_t id, struct keyval *tags, struct osmNode *nodes, int count, int exists));
43    void (*iterate_relations)(int (*callback)(osmid_t id, struct member *, int member_count, struct keyval *rel_tags, int exists));
44};
45
46#endif
Note: See TracBrowser for help on using the repository browser.