source: subversion/applications/utils/export/osm2pgsql/build_geometry.h @ 15536

Last change on this file since 15536 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: 1.6 KB
Line 
1/*
2#-----------------------------------------------------------------------------
3# Part of osm2pgsql utility
4#-----------------------------------------------------------------------------
5# By Artem Pavlenko, Copyright 2007
6#
7# This program is free software; you can redistribute it and/or
8# modify it under the terms of the GNU General Public License
9# as published by the Free Software Foundation; either version 2
10# of the License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20#-----------------------------------------------------------------------------
21*/
22
23#ifndef BUILD_GEOMETRY_H
24#define BUILD_GEOMETRY_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include "osmtypes.h"
31
32int parse_wkt(const char * wkt, struct osmNode *** xnodes, int ** xcount, int * polygon);
33
34char *get_wkt_simple(struct osmNode *, int count, int polygon, double *area, double *int_x, double *int_y);
35
36char* get_wkt(size_t index);
37void get_interior(size_t index, double *y, double *x);
38double get_area(size_t index);
39size_t build_geometry(int osm_id, struct osmNode **xnodes, int *xcount, int make_polygon);
40void clear_wkts();
41
42#ifdef __cplusplus
43}
44#endif
45   
46#endif
Note: See TracBrowser for help on using the repository browser.