pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edges_input.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: edges_input.h
3 
4 Copyright (c) 2015 Celia Virginia Vergara Castillo
5 vicky_vergara@hotmail.com
6 
7 ------
8 
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 
23 ********************************************************************PGR-GNU*/
24 
25 #ifndef SRC_COMMON_SRC_EDGES_INPUT_H_
26 #define SRC_COMMON_SRC_EDGES_INPUT_H_
27 #pragma once
28 
29 #include "./pgr_types.h"
30 
31 
46  char *edges_sql,
47  pgr_edge_t **edges,
48  size_t *total_edges);
49 
50 
51 
52 
53 
66 void pgr_get_edges(
67  char *edges_sql,
68  pgr_edge_t **edges,
69  size_t *total_edges);
70 
71 
72 
85 void pgr_get_edges_xy(
86  char *edges_sql,
88  size_t *total_edges);
89 
111  char *edges_sql,
113  size_t *total_edges);
114 
115 
130 void pgr_get_flow_edges(
131  char *sql,
132  pgr_edge_t **edges,
133  size_t *total_edges);
134 
148  char *sql,
150  size_t *total_edges);
151 
152 /* **************** FOR USERS DOCUMENTATION
153 basic_edges_sql_start
154 
155 Description of the edges_sql query
156 ...............................................................................
157 
158 :edges_sql: an SQL query, which should return a set of rows with the following columns:
159 
160 ================ =================== ======== =================================================
161 Column Type Default Description
162 ================ =================== ======== =================================================
163 **id** ``ANY-INTEGER`` Identifier of the edge.
164 **source** ``ANY-INTEGER`` Identifier of the first end point vertex of the edge.
165 **target** ``ANY-INTEGER`` Identifier of the second end point vertex of the edge.
166 **cost** ``ANY-NUMERICAL`` Weight of the edge `(source, target)`
167  - When negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
168 **reverse_cost** ``ANY-NUMERICAL`` -1 Weight of the edge `(target, source)`,
169  - When negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
170 ================ =================== ======== =================================================
171 
172 Where:
173 
174 :ANY-INTEGER: SMALLINT, INTEGER, BIGINT
175 :ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
176 
177 basic_edges_sql_end
178 
179 no_id_edges_sql_start
180 
181 Description of the edges_sql query
182 ...............................................................................
183 
184 :edges_sql: an SQL query, which should return a set of rows with the following columns:
185 
186 ================ =================== ======== =================================================
187 Column Type Default Description
188 ================ =================== ======== =================================================
189 **source** ``ANY-INTEGER`` Identifier of the first end point vertex of the edge.
190 **target** ``ANY-INTEGER`` Identifier of the second end point vertex of the edge.
191 **cost** ``ANY-NUMERICAL`` Weight of the edge `(source, target)`
192  * When negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
193 **reverse_cost** ``ANY-NUMERICAL`` -1 Weight of the edge `(target, source)`,
194  - When negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
195 ================ =================== ======== =================================================
196 
197 Where:
198 
199 :ANY-INTEGER: SMALLINT, INTEGER, BIGINT
200 :ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
201 
202 no_id_edges_sql_end
203 
204 
205 xy_edges_sql_start
206 
207 Description of the edges_sql query
208 ...............................................................................
209 
210 :edges_sql: an SQL query, which should return a set of rows with the following columns:
211 
212 ================ =================== ======== =================================================
213 Column Type Default Description
214 ================ =================== ======== =================================================
215 **id** ``ANY-INTEGER`` Identifier of the edge.
216 **source** ``ANY-INTEGER`` Identifier of the first end point vertex of the edge.
217 **target** ``ANY-INTEGER`` Identifier of the second end point vertex of the edge.
218 **cost** ``ANY-NUMERICAL`` Weight of the edge `(source, target)`
219  - When negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
220 **reverse_cost** ``ANY-NUMERICAL`` -1 Weight of the edge `(target, source)`,
221  - When negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
222 
223 **x1** ``ANY-NUMERICAL`` X coordinate of `source` vertex.
224 **y1** ``ANY-NUMERICAL`` Y coordinate of `source` vertex.
225 **x2** ``ANY-NUMERICAL`` X coordinate of `target` vertex.
226 **y2** ``ANY-NUMERICAL`` Y coordinate of `target` vertex.
227 ================ =================== ======== =================================================
228 
229 Where:
230 
231 :ANY-INTEGER: SMALLINT, INTEGER, BIGINT
232 :ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
233 
234 xy_edges_sql_end
235 */
236 
237 #endif // SRC_COMMON_SRC_EDGES_INPUT_H_
void pgr_get_edges(char *edges_sql, pgr_edge_t **edges, size_t *total_edges)
basic edge_sql
Definition: edges_input.c:535
void pgr_get_edges_xy(char *edges_sql, Pgr_edge_xy_t **edges, size_t *total_edges)
Edges with x, y vertices values.
Definition: edges_input.c:553
void pgr_get_edges_no_id(char *edges_sql, pgr_edge_t **edges, size_t *total_edges)
edges_sql without id parameter
Definition: edges_input.c:544
void pgr_get_basic_edges(char *sql, pgr_basic_edge_t **edges, size_t *total_edges)
read basic edges
Definition: edges_input.c:568
void pgr_get_flow_edges(char *sql, pgr_edge_t **edges, size_t *total_edges)
read edges for flow
Definition: edges_input.c:526
edge_astar_t * edges
Definition: BDATester.cpp:46
void pgr_get_edges_xy_reversed(char *edges_sql, Pgr_edge_xy_t **edges, size_t *total_edges)
for many to 1 on aStar
Definition: edges_input.c:560