/* Ways */
/* Select neareset ways inside lat,lon+-range */
if (sqlite3_prepare_v2(db, "select wid,type,nodes,flags,"
- "(($LAT-lat)*($LAT-lat))+(($LON-lon)*($LON-lon)) as d,f,t,lat,lon "
- " from way as w,way_n2n as ws,nodes as n "
- " where w.wid=ws.wsid and ws.f=n.nid "
+ "(($LAT-lat)*($LAT-lat))+(($LON-lon)*($LON-lon)) as d,wn.f,wn.t,n.lat,n.lon "
+ " from way as w,way_n2n as wn,nodes as n "
+ " where w.wid=wn.wsid and wn.f=n.nid "
" and n.lat between $LAT-$RANGE and $LAT+$RANGE "
" and n.lon between $LON-$RANGE and $LON+$RANGE "
" and w.type between $WTS and $WTY "
-1, &sql.select_way2, NULL)!=SQLITE_OK)
return FALSE;
-if (sqlite3_prepare_v2(db, "select t,lat,lon from way_n2n,nodes where wsid=? and f=? and way_n2n.t=nodes.nid limit 1",
+if (sqlite3_prepare_v2(db, "select wn.t,lat,lon from way_n2n as wn,nodes where wsid=? and wn.f=? and wn.t=nodes.nid limit 1",
-1, &sql.select_way_next_seg, NULL)!=SQLITE_OK)
return FALSE;
-if (sqlite3_prepare_v2(db, "select f,lat,lon from way_n2n,nodes where wsid=? and t=? and way_n2n.f=nodes.nid limit 1",
+if (sqlite3_prepare_v2(db, "select wn.f,lat,lon from way_n2n as wn,nodes where wsid=? and wn.t=? and wn.f=nodes.nid limit 1",
-1, &sql.select_way_prev_seg, NULL)!=SQLITE_OK)
return FALSE;