source: subversion/applications/utils/export/osm2pgsql-intarray/middle.h @ 28719

Last change on this file since 28719 was 13612, checked in by stevehill, 11 years ago

Adds tile expiry support - see

This introduces 2 new commandline
options: "-e <zoomlevel>" and "-o <dirty tile list output file>". So,
specifying "-e 17 -o /tmp/dirty_tiles" when importing a delta will cause
osm2pgsql to generate a list of all zoom level 17 tiles which the delta
has made dirty and store it in /tmp/dirty_tiles.

Proviso: for polygons, it currently takes a simplistic approach of drawing
a bounding box around the whole polygon and marking every tile in the box
as dirty. If the bounding box is large (over 30x30Km) the polygon is
treated as a line instead, so only the perimeter will be marked as dirty
(this is so that huge polygons don't expire vast numbers of tiles and is
based on the assumption that we probably aren't going to shade the area
of massive polygons).

The dirty tile list is maintained in memory as a binary tree and dumped to
disk at the end of the run.

File size: 1.6 KB
1/* Common middle layer interface */
3/* Each middle layer data store must provide methods for
4 * storing and retrieving node and way data.
5 */
7#ifndef MIDDLE_H
8#define MIDDLE_H
10#include "osmtypes.h"
12struct keyval;
13struct member;
14struct output_options;
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);
23    int (*nodes_set)(int id, double lat, double lon, struct keyval *tags);
24    int (*nodes_get_list)(struct osmNode *out, int *nds, int nd_count);
25    int (*nodes_delete)(int id);
26    int (*node_changed)(int id);
27//    int (*nodes_get)(struct osmNode *out, int id);
29    int (*ways_set)(int id, int *nds, int nd_count, struct keyval *tags, int pending);
30    int (*ways_get)(int id, struct keyval *tag_ptr, struct osmNode **node_ptr, int *count_ptr);
31    int (*ways_done)(int id);
32    int (*ways_delete)(int id);
33    int (*way_changed)(int id);
35    int (*relations_set)(int id, struct member *members, int member_count, struct keyval *tags);
36//    int (*relations_get)(int id, struct member **members, int *member_count, struct keyval *tags);
37    int (*relations_done)(int id);
38    int (*relations_delete)(int id);
39    int (*relation_changed)(int id);
41//    void (*iterate_nodes)(int (*callback)(int id, struct keyval *tags, double node_lat, double node_lon));
42    void (*iterate_ways)(int (*callback)(int id, struct keyval *tags, struct osmNode *nodes, int count, int exists));
43    void (*iterate_relations)(int (*callback)(int id, struct member *, int member_count, struct keyval *rel_tags, int exists));
Note: See TracBrowser for help on using the repository browser.