return FALSE;
/* Ways */
-/* Select neareset ways inside lat,lon+-range */
+/* Select nearest 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,wn.f,wn.t,n.lat,n.lon "
" from way as w,way_n2n as wn,nodes as n "
-1, &sql.select_way2, NULL)!=SQLITE_OK)
return FALSE;
-if (sqlite3_prepare_v2(db, "select w.wid,w.name as name from way_names where w.type between $WTS and $WTY and w.name like ? "
+if (sqlite3_prepare_v2(db, "select w.wid,w.name as name from way_names as w,way as ww where ww.type between $WTS and $WTY and w.wid=ww.wid and w.name like ? "
" union "
- " select w.wid,n.name as name from way_names as w,way_names_nls as n on w.wid=n.wid where "
- " w.type between $WTS and $WTY and n.name like ? order by name",
+ " select w.wid,n.name as name from way_names as w, way as ww,way_names_nls as n on w.wid=n.wid where "
+ " ww.type between $WTS and $WTY and w.wid=ww.wid and n.name like ? order by name",
-1, &sql.select_way_name_search, NULL)!=SQLITE_OK)
return FALSE;