]> err.no Git - mapper/blob - src/osm-db.h
Merge branch 'master' of git+ssh://tal.org/home/git/mapper
[mapper] / src / osm-db.h
1 /*
2  * This file is part of mapper
3  *
4  * Copyright (C) 2007 Kaj-Michael Lang
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef _OSM_DB_H
22 #define _OSM_DB_H
23
24 #include <glib.h>
25 #include "osm.h"
26
27 #define OSM_RANGE_WAY (20000)
28
29 gboolean osm_init(void);
30 void osm_deinit(void);
31
32 void osm_set_way_range_from_speed(gfloat speed);
33 void osm_set_way_range(guint sr);
34
35 void osm_progress_set_widget(sqlite3 *db, GtkProgressBar *w);
36 gboolean osm_db_prepare(sqlite3 *db);
37
38 gboolean osm_way_get_nodes(osm_way *w);
39 gboolean osm_way_get_name(osm_way *w);
40 gboolean osm_way_get_ref(osm_way *w);
41
42 gboolean osm_find_nearest_place(node_type_t type, gint lat, gint lon, osm_place **nr);
43 osm_way *osm_find_nearest_way(gint lat, gint lon);
44 gboolean osm_way_distance(gint lat, gint lon, osm_way_node *f, osm_way_node *t, gdouble *d);
45
46 gboolean osm_place_get(guint32 id, gint lat, gint lon, osm_place **nr);
47
48 gboolean osm_get_location_data(gint lat, gint lon, osm_location *map_loc);
49
50 osm_way_node *osm_way_node_new(guint id, gint lat, gint lon, gint flags);
51
52 void osm_way_node_free(osm_way_node *n);
53 void osm_way_free(osm_way *w);
54 void osm_way_nodes_free(osm_way *w);
55
56 #endif