PGROUTING  3.2
get_new_queries.cpp File Reference
#include "drivers/withPoints/get_new_queries.h"
#include <string.h>
#include <sstream>
#include "cpp_common/pgr_alloc.hpp"
Include dependency graph for get_new_queries.cpp:

Go to the source code of this file.

Functions

char estimate_drivingSide (char driving_side)
 
void get_new_queries (char *edges_sql, char *points_sql, char **edges_of_points_query, char **edges_no_points_query)
 

Function Documentation

◆ estimate_drivingSide()

char estimate_drivingSide ( char  driving_side)

Definition at line 36 of file get_new_queries.cpp.

36  {
37  char d_side = static_cast<char>(tolower(driving_side));
38  if (!((d_side == 'r')
39  || (d_side == 'l'))) {
40  d_side = 'b';
41  }
42  return d_side;
43 }

Referenced by process().

◆ get_new_queries()

void get_new_queries ( char *  edges_sql,
char *  points_sql,
char **  edges_of_points_query,
char **  edges_no_points_query 
)

Definition at line 46 of file get_new_queries.cpp.

50  {
51  std::ostringstream edges_of_points_sql;
52  std::ostringstream edges_no_points_sql;
53 
54  edges_of_points_sql << "WITH "
55  << " edges AS (" << edges_sql << "), "
56  << " points AS (" << points_sql << ")"
57  << " SELECT DISTINCT edges.* FROM edges JOIN points ON (id = edge_id)";
58  *edges_of_points_query = pgr_msg(edges_of_points_sql.str().c_str());
59 
60  edges_no_points_sql << "WITH "
61  << " edges AS (" << edges_sql << "), "
62  << " points AS (" << points_sql << ")"
63  << " SELECT edges.*"
64  << " FROM edges"
65  << " WHERE NOT EXISTS (SELECT edge_id FROM points WHERE id = edge_id)";
66  *edges_no_points_query = pgr_msg(edges_no_points_sql.str().c_str());
67 }

References pgr_msg().

Referenced by process().

pgr_msg
char * pgr_msg(const std::string &msg)
Definition: pgr_alloc.cpp:30