snprintf(z_req,1024,"SELECT id FROM rv_nodes WHERE geom && ST_Expand('SRID=4326;POINT(%.8f %.8f)'::geometry,%f) ORDER BY ST_Distance(geom,'POINT(%.8f %.8f)'::geography) LIMIT 1;",d_lon,d_lat,diam,d_lon,d_lat);
snprintf(z_req,1024,"SELECT id,cc,ST_Distance(geom,'POINT(%.8f %.8f)'::geography) AS d FROM rv_nodes WHERE geom && ST_Expand('SRID=4326;POINT(%.8f %.8f)'::geometry,%f) AND cc=%llu ORDER BY d LIMIT 1;",d_lon,d_lat,d_lon,d_lat,diam,ull_cc);
else
snprintf(z_req,1024,"SELECT id,cc,ST_Distance(geom,'POINT(%.8f %.8f)'::geography) AS d FROM rv_nodes WHERE geom && ST_Expand('SRID=4326;POINT(%.8f %.8f)'::geometry,%f) ORDER BY d LIMIT 1;",d_lon,d_lat,d_lon,d_lat,diam);
snprintf(z_req,1024,"SELECT way_id FROM rv_edges WHERE from_id=%lld AND to_id=%lld;",ull_from,ull_to);
snprintf(z_req,1024,"SELECT way_id,version FROM rv_edges INNER JOIN ways ON ways.id=rv_edges.way_id WHERE from_id=%lld AND to_id=%lld;",ull_from,ull_to);
pqxx::resultr=txn.exec(z_req);
if(r.size()==0)
...
...
@@ -66,9 +179,9 @@ edge database::get_edge(const unsigned long long & ull_from, const unsigned long