From: Kaj-Michael Lang Date: Thu, 25 Oct 2007 12:29:14 +0000 (+0300) Subject: Handle new f field in nodes table. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37ed966c76f836b8abccc2285d29da695b7ea48f;p=mapper Handle new f field in nodes table. --- diff --git a/src/osm-db.c b/src/osm-db.c index 771a89a..204737f 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -156,9 +156,9 @@ if (sqlite3_prepare_v2(db, "select name,(($LAT-lat)*($LAT-lat))+(($LON-lon)*($LO /* 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 " @@ -166,11 +166,11 @@ 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 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;