57 pgr_edge_t *edges_of_points,
size_t total_edges_of_points,
70 std::ostringstream log;
71 std::ostringstream err;
72 std::ostringstream notice;
82 std::vector<Point_on_edge_t>(
84 points_p + total_points),
85 std::vector< pgr_edge_t >(
87 edges_of_points + total_edges_of_points),
95 *log_msg =
pgr_msg(log.str().c_str());
96 *err_msg =
pgr_msg(err.str().c_str());
101 int64_t start_vid(start_pid);
102 int64_t end_vid(end_pid);
104 log <<
"start_pid" << start_pid <<
"\n";
105 log <<
"end_pid" << end_pid <<
"\n";
106 log <<
"driving_side" << driving_side <<
"\n";
107 log <<
"start_vid" << start_vid <<
"\n";
108 log <<
"end_vid" << end_vid <<
"\n";
111 std::deque< Path > paths;
116 log <<
"extracted vertices: ";
117 for (
const auto& v : vertices) {
123 log <<
"Working with directed Graph\n";
126 log <<
"graph after inserting edges\n";
127 log << digraph <<
"\n";
130 log <<
"graph after inserting new edges\n";
131 log << digraph <<
"\n";
134 paths = fn_yen.
Yen(digraph, start_vid, end_vid, k, heap_paths);
137 log <<
"Working with undirected Graph\n";
143 paths = fn_yen.
Yen(undigraph, start_vid, end_vid, k, heap_paths);
148 for (
auto &path : paths) {
160 *return_tuples = NULL;
161 *return_tuples =
pgr_alloc(count, (*return_tuples));
165 for (
const auto &path : paths) {
167 path.get_pg_ksp_path(return_tuples, sequence, route_id);
171 if (count != sequence) {
174 (*return_count) = sequence;
176 *log_msg = log.str().empty()?
179 *notice_msg = notice.str().empty()?
184 (*return_tuples) =
pgr_free(*return_tuples);
186 err << except.
what();
187 *err_msg =
pgr_msg(err.str().c_str());
188 *log_msg =
pgr_msg(log.str().c_str());
189 }
catch (std::exception &except) {
190 (*return_tuples) =
pgr_free(*return_tuples);
192 err << except.what();
193 *err_msg =
pgr_msg(err.str().c_str());
194 *log_msg =
pgr_msg(log.str().c_str());
196 (*return_tuples) =
pgr_free(*return_tuples);
198 err <<
"Caught unknown exception!";
199 *err_msg =
pgr_msg(err.str().c_str());
200 *log_msg =
pgr_msg(log.str().c_str());