Files
osm2pgsql/middle.h
Martijn van Oosterhout 4bece011c2 Add a caching level to the slim-mode with configurable size, so it actually
has decent performance.  It is implemented as a lossy sparse array with a
priority queue tracking how much of each block is used to ensure we maximize
the number of nodes we fit in the given amount of memory.

Also rearrange some header definitions.
2008-04-12 17:05:11 +00:00

33 lines
1.3 KiB
C

/* Common middle layer interface */
/* Each middle layer data store must provide methods for
* storing and retrieving node and way data.
*/
#ifndef MIDDLE_H
#define MIDDLE_H
struct keyval;
struct member;
struct output_options;
struct middle_t {
int (*start)(const struct output_options *options);
void (*stop)(void);
void (*cleanup)(void);
void (*analyze)(void);
void (*end)(void);
int (*nodes_set)(int id, double lat, double lon, struct keyval *tags);
int (*nodes_get_list)(struct osmNode *out, int *nds, int nd_count);
// int (*nodes_get)(struct osmNode *out, int id);
int (*ways_set)(int id, int *nds, int nd_count, struct keyval *tags, int pending);
int (*ways_get)(int id, struct keyval *tag_ptr, struct osmNode **node_ptr, int *count_ptr);
int (*ways_done)(int id);
int (*relations_set)(int id, struct member *members, int member_count, struct keyval *tags);
// void (*iterate_nodes)(int (*callback)(int id, struct keyval *tags, double node_lat, double node_lon));
void (*iterate_ways)(int (*callback)(int id, struct keyval *tags, struct osmNode *nodes, int count));
// void (*iterate_relations)(int (*callback)(int id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count));
};
#endif