source: subversion/applications/utils/export/osm2pgsql/output.h @ 26664

Revision 26664, 3.1 KB checked in by apmon, 3 years ago (diff)

[Osm2pgsql] Add an option to disable parallel indexing

This is a patch by Hartmut Holzgraefe (  https://github.com/hholzgra/osm2pgsql/commit/f779298ba9b2cc84b3949f3fd4b684ea64bcee34),
although it was adapted to have parallel indexing the default and the option disables it.

Under the conditions I have tested, parallel indexing seemed to be slightly faster than sequential indexing, but that may depend
on hard and or software, as well as the size of the planet (extract) to import, hence the option to disable it.

Line 
1/* Common output layer interface */
2
3/* Each output layer must provide methods for
4 * storing:
5 * - Nodes (Points of interest etc)
6 * - Way geometries
7 * Associated tags: name, type etc.
8*/
9
10#ifndef OUTPUT_H
11#define OUTPUT_H
12
13#include "middle.h"
14#include "keyvals.h"
15
16/* Variants for generation of hstore column */
17/* No hstore column */
18#define HSTORE_NONE 0
19/* create a hstore column for all tags which do not have an exclusive column */
20#define HSTORE_NORM 1
21/* create a hstore column for all tags */
22#define HSTORE_ALL 2
23
24struct output_options {
25  const char *conninfo;  /* Connection info string */
26  const char *prefix;    /* prefix for table names */
27  int scale;       /* scale for converting coordinates to fixed point */
28  int projection;  /* SRS of projection */
29  int append;      /* Append to existing data */
30  int slim;        /* In slim mode */
31  int cache;       /* Memory usable for cache in MB */
32  struct middle_t *mid;  /* Mid storage to use */
33  const char *tblsmain_index;     /* Pg Tablespace to store indexes on main tables */
34  const char *tblsslim_index;     /* Pg Tablespace to store indexes on slim tables */
35  const char *tblsmain_data;     /* Pg Tablespace to store main tables */
36  const char *tblsslim_data;     /* Pg Tablespace to store slim tables */
37  const char *style;     /* style file to use */
38  int expire_tiles_zoom;        /* Zoom level for tile expiry list */
39  int expire_tiles_zoom_min;    /* Minimum zoom level for tile expiry list */
40  const char *expire_tiles_filename;    /* File name to output expired tiles list to */
41  int enable_hstore; /* add an additional hstore column with objects key/value pairs */
42  int enable_multi; /* Output multi-geometries intead of several simple geometries */
43  const char** hstore_columns; /* list of columns that should be written into their own hstore column */
44  int n_hstore_columns; /* number of hstore columns */
45  int keep_coastlines;
46  int parallel_indexing;
47};
48
49struct output_t {
50    int (*start)(const struct output_options *options);
51    void (*stop)();
52    void (*cleanup)(void);
53//    void (*process)(struct middle_t *mid);
54//    int (*node)(osmid_t id, struct keyval *tags, double node_lat, double node_lon);
55//    int (*way)(osmid_t id, struct keyval *tags, struct osmNode *nodes, int count);
56//    int (*relation)(osmid_t id, struct keyval *rel_tags, struct osmNode **nodes, struct keyval **tags, int *count);
57
58    int (*node_add)(osmid_t id, double lat, double lon, struct keyval *tags);
59    int (*way_add)(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
60    int (*relation_add)(osmid_t id, struct member *members, int member_count, struct keyval *tags);
61
62    int (*node_modify)(osmid_t id, double lat, double lon, struct keyval *tags);
63    int (*way_modify)(osmid_t id, osmid_t *nodes, int node_count, struct keyval *tags);
64    int (*relation_modify)(osmid_t id, struct member *members, int member_count, struct keyval *tags);
65
66    int (*node_delete)(osmid_t id);
67    int (*way_delete)(osmid_t id);
68    int (*relation_delete)(osmid_t id);
69};
70
71unsigned int pgsql_filter_tags(enum OsmType type, struct keyval *tags, int *polygon);
72
73#endif
Note: See TracBrowser for help on using the repository browser.