]> err.no Git - mapper/blob - src/osm-db-import.h
Add header and cast properly.
[mapper] / src / osm-db-import.h
1 #ifndef _OSM_DB_IMPORT_H
2 #define _OSM_DB_IMPORT_H
3
4 #include <glib.h>
5
6 #include "osm.h"
7
8 /* POI or Place node extra data */
9 typedef struct _node_data node_data;
10 struct _node_data {
11         gchar *name;
12         gchar *desc;
13         gchar *url;
14         gchar *postal_code;
15         guint32 isin_c;
16         guint32 isin_p;
17 };
18
19 /* Node type */
20 typedef struct _node node;
21 struct _node {
22         guint32 id;
23         gdouble lat;
24         gdouble lon;
25         node_type_t type;
26         node_data *data;
27 };
28
29 /* Way data structure */
30 typedef struct _way_data way_data;
31 struct _way_data {
32         gchar *name;
33         GHashTable *names;
34         gchar *ref;
35         gchar *int_ref;
36         gchar *postal_code;
37         guint32 isin_c; /* Country */
38         guint32 isin_p; /* Primary (city, village) place */
39         guint speed;
40         gint8 layer;
41 };
42
43 /* Way structure */
44 typedef struct _way way;
45 struct _way {
46         guint32 id;
47         way_type_t type;
48         guint16 ncnt;
49         guint8 flags;
50         way_data *data;
51         GSList *nodes;
52 };
53
54 struct map_bbox {
55         gdouble lat_min;
56         gdouble lon_min;
57         gdouble lat_max;
58         gdouble lon_max;
59 };
60
61 /* Struct with import request */
62 typedef struct _osm_import_data_req osm_import_data_req;
63 struct _osm_import_data_req {
64         gchar *planet;
65         gchar *db;
66         GSourceFunc progress_cb;
67         GSourceFunc done_cb;
68 };
69
70 void osm_import_set_bbox(gboolean use_bb, gdouble latmin, gdouble lonmin, gdouble latmax, gdouble lonmax);
71 gboolean osm_import(const gchar *planet, const gchar *database);
72 gboolean osm_import_bg(const gchar *planet, const gchar *database, GSourceFunc progress_cb, GSourceFunc done_cb);
73 gint osm_import_join_bg(void);
74
75 #endif