From 31a6a504c615b31521166369635e18e5e5db74a9 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 31 Oct 2007 09:32:25 +0200 Subject: [PATCH] Small fix to way name search sql --- src/osm-db.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osm-db.c b/src/osm-db.c index f53bd23..7a1643e 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -157,7 +157,7 @@ if (sqlite3_prepare_v2(db, "select name,(($LAT-lat)*($LAT-lat))+(($LON-lon)*($LO 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 " @@ -169,10 +169,10 @@ if (sqlite3_prepare_v2(db, "select wid,type,nodes,flags," -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; -- 2.39.5