sqlite3_stmt *select_way_ref;
sqlite3_stmt *select_place;
sqlite3_stmt *select_near_place;
+
+ sqlite3_stmt *select_node_next;
+ sqlite3_stmt *select_node_prev;
};
static struct sql_select_stmt sql;
static GTimer *dbt;
return FALSE;
/* Way name */
-if (sqlite3_prepare_v2(db, "select name from way_names where wid=?",
- -1, &sql.select_way_name, NULL)!=SQLITE_OK)
+if (sqlite3_prepare_v2(db, "select name from way_names where wid=?", -1, &sql.select_way_name, NULL)!=SQLITE_OK)
return FALSE;
/* Way ref and int_ref */
-if (sqlite3_prepare_v2(db, "select ref,int_ref from way_ref where rid=?",
- -1, &sql.select_way_ref, NULL)!=SQLITE_OK)
+if (sqlite3_prepare_v2(db, "select ref,int_ref from way_ref where rid=?", -1, &sql.select_way_ref, NULL)!=SQLITE_OK)
+ return FALSE;
+
+/* Get next, prev node + way information. For routing. */
+if (sqlite3_prepare_v2(db, "select w.wid,w.type,w.flags,w.speed,n.nid,n.rlat,n.rlon,nn.f,nn.t,n.f,n.l "
+ "from way as w, nodes as n, way_n2n as nn where w.wid=nn.wid and nn.f=n.nid and nn.f=?",
+ -1, &sql.select_node_next, NULL)!=SQLITE_OK)
+ return FALSE;
+
+if (sqlite3_prepare_v2(db, "select w.wid,w.type,w.flags,w.speed,n.nid,n.rlat,n.rlon,nn.f,nn.t,n.f,n.l "
+ "from way as w, nodes as n, way_n2n as nn where w.wid=nn.wid and nn.f=n.nid and nn.t=?",
+ -1, &sql.select_node_next, NULL)!=SQLITE_OK)
return FALSE;
return TRUE;