PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edges_input.c File Reference
#include "./postgres_connection.h"
#include "./debug_macro.h"
#include "./pgr_types.h"
#include "./get_check_data.h"
#include "./edges_input.h"
#include "./time_msg.h"

Go to the source code of this file.

Functions

static void fetch_basic_edge (HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info[5], int64_t *default_id, pgr_basic_edge_t *edge, size_t *valid_edges)
 
static void fetch_edge (HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info[5], int64_t *default_id, float8 default_rcost, pgr_edge_t *edge, size_t *valid_edges, bool normal)
 
static void fetch_edge_with_xy (HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info[9], int64_t *default_id, float8 default_rcost, Pgr_edge_xy_t *edge, size_t *valid_edges, bool normal)
 
static void get_edges_5_columns (char *sql, pgr_edge_t **edges, size_t *totalTuples, bool ignore_id, bool normal)
 
static void get_edges_9_columns (char *sql, Pgr_edge_xy_t **edges, size_t *total_edges, bool normal)
 
static void get_edges_basic (char *sql, pgr_basic_edge_t **edges, size_t *totalTuples, bool ignore_id)
 
static void get_edges_flow (char *sql, pgr_edge_t **edges, size_t *totalTuples, bool ignore_id)
 
void pgr_get_basic_edges (char *sql, pgr_basic_edge_t **edges, size_t *total_edges)
 read basic edges More...
 
void pgr_get_edges (char *edges_sql, pgr_edge_t **edges, size_t *total_edges)
 basic edge_sql More...
 
void pgr_get_edges_no_id (char *edges_sql, pgr_edge_t **edges, size_t *total_edges)
 edges_sql without id parameter More...
 
void pgr_get_edges_reversed (char *edges_sql, pgr_edge_t **edges, size_t *total_edges)
 
void pgr_get_edges_xy (char *edges_sql, Pgr_edge_xy_t **edges, size_t *total_edges)
 Edges with x, y vertices values. More...
 
void pgr_get_edges_xy_reversed (char *edges_sql, Pgr_edge_xy_t **edges, size_t *total_edges)
 for many to 1 on aStar More...
 
void pgr_get_flow_edges (char *sql, pgr_edge_t **edges, size_t *total_edges)
 read edges for flow More...
 

Function Documentation

static void fetch_basic_edge ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
Column_info_t  info[5],
int64_t *  default_id,
pgr_basic_edge_t edge,
size_t *  valid_edges 
)
static
static void fetch_edge ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
Column_info_t  info[5],
int64_t *  default_id,
float8  default_rcost,
pgr_edge_t edge,
size_t *  valid_edges,
bool  normal 
)
static
static void fetch_edge_with_xy ( HeapTuple *  tuple,
TupleDesc *  tupdesc,
Column_info_t  info[9],
int64_t *  default_id,
float8  default_rcost,
Pgr_edge_xy_t edge,
size_t *  valid_edges,
bool  normal 
)
static
static void get_edges_5_columns ( char *  sql,
pgr_edge_t **  edges,
size_t *  totalTuples,
bool  ignore_id,
bool  normal 
)
static
static void get_edges_9_columns ( char *  sql,
Pgr_edge_xy_t **  edges,
size_t *  total_edges,
bool  normal 
)
static
static void get_edges_basic ( char *  sql,
pgr_basic_edge_t **  edges,
size_t *  totalTuples,
bool  ignore_id 
)
static
static void get_edges_flow ( char *  sql,
pgr_edge_t **  edges,
size_t *  totalTuples,
bool  ignore_id 
)
static
void pgr_get_basic_edges ( char *  sql,
pgr_basic_edge_t **  edges,
size_t *  total_edges 
)

read basic edges

Edges:

bigint id, bigint source, bigint target

Parameters
[in]sql
[out]edges
[out]total_edges

Definition at line 594 of file edges_input.c.

References get_edges_basic().

Referenced by process().

void pgr_get_edges ( char *  edges_sql,
pgr_edge_t **  edges,
size_t *  total_edges 
)

basic edge_sql

For queries of the type:

SELECT id, source, target, cost, [reverse_cost]
FROM edge_table;
Parameters
[in]edges_sql
[out]edges
[out]total_edges

Definition at line 539 of file edges_input.c.

References get_edges_5_columns().

Referenced by compute(), and process().

void pgr_get_edges_no_id ( char *  edges_sql,
pgr_edge_t **  edges,
size_t *  total_edges 
)

edges_sql without id parameter

SELECT source, target, cost, [reverse_cost]
FROM edge_table;

Currently used in: allpairs

Parameters
[in]edges_sql
[out]edges
[out]total_edges

Definition at line 561 of file edges_input.c.

References get_edges_5_columns().

Referenced by process().

void pgr_get_edges_reversed ( char *  edges_sql,
pgr_edge_t **  edges,
size_t *  total_edges 
)

Definition at line 550 of file edges_input.c.

References get_edges_5_columns().

Referenced by process().

void pgr_get_edges_xy ( char *  edges_sql,
Pgr_edge_xy_t **  edges,
size_t *  total_edges 
)

Edges with x, y vertices values.

For queries of the type:

SELECT id, source, target, cost, [reverse_cost], x1, y1, x2, y2
FROM edge_table;
Parameters
[in]edges_sql
[out]edges
[out]total_edges

Definition at line 572 of file edges_input.c.

References get_edges_9_columns().

Referenced by process().

void pgr_get_edges_xy_reversed ( char *  edges_sql,
Pgr_edge_xy_t **  edges,
size_t *  total_edges 
)

for many to 1 on aStar

Used internally

Transforms queries of the type:

SELECT id, source, target, cost, [reverse_cost], x1, y1, x2, y2
FROM edge_table;

to

SELECT id, target, source, cost, [reverse_cost], x1, y1, x2, y2
FROM edge_table;
Parameters
[in]edges_sql
[out]edges
[out]total_edges

Definition at line 585 of file edges_input.c.

References get_edges_9_columns().

Referenced by process().

void pgr_get_flow_edges ( char *  sql,
pgr_edge_t **  edges,
size_t *  total_edges 
)

read edges for flow

Edges:

bigint id, bigint source, bigint target, bigint capacity, bigint reverse_capacity

Parameters
[in]sql
[out]edges
[out]total_edges

Definition at line 529 of file edges_input.c.

References get_edges_flow().

Referenced by process().