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

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

Adds tile expiry support - see http://lists.openstreetmap.org/pipermail/dev/2009-February/013934.html

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: 528 bytes
Line 
1#ifndef EXPIRE_TILES_H
2#define EXPIRE_TILES_H
3
4#include "output.h"
5
6void expire_tiles_init(const struct output_options *options);
7void expire_tiles_stop(void);
8int expire_tiles_from_bbox(double min_lon, double min_lat, double max_lon, double max_lat);
9void expire_tiles_from_nodes_line(struct osmNode * nodes, int count);
10void expire_tiles_from_nodes_poly(struct osmNode * nodes, int count, int osm_id);
11void expire_tiles_from_wkt(const char * wkt, int osm_id);
12void expire_tiles_from_db(PGconn * sql_conn, int osm_id);
13
14#endif
Note: See TracBrowser for help on using the repository browser.