#include <stddef.h>
#include "c_types/delauny_t.h"
Go to the source code of this file.
◆ pgr_get_delauny()
void pgr_get_delauny |
( |
char * |
sql, |
|
|
Delauny_t ** |
delauny, |
|
|
size_t * |
total_delauny |
|
) |
| |
bigint tid, bigint pid, float x, float y,
Definition at line 53 of file delauny_input.c.
57 clock_t start_t = clock();
59 const int tuple_limit = 1000000;
61 size_t total_tuples = 0;
66 for (i = 0; i < 4; ++i) {
88 (*total_delauny) = total_tuples;
90 while (moredata ==
true) {
91 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
92 if (total_tuples == 0)
95 size_t ntuples = SPI_processed;
96 total_tuples += ntuples;
99 if ((*delauny) == NULL)
101 palloc0(total_tuples *
sizeof(
Delauny_t));
107 if ((*delauny) == NULL) {
108 elog(ERROR,
"Out of memory");
111 SPITupleTable *tuptable = SPI_tuptable;
112 TupleDesc tupdesc = SPI_tuptable->tupdesc;
115 for (t = 0; t < ntuples; t++) {
116 HeapTuple tuple = tuptable->vals[t];
118 &(*delauny)[total_tuples - ntuples + t]);
120 SPI_freetuptable(tuptable);
126 SPI_cursor_close(SPIportal);
129 if (total_tuples == 0) {
130 (*total_delauny) = 0;
134 (*total_delauny) = total_tuples;
136 time_msg(
" calculating Delauny triangles:", start_t, clock());
References ANY_INTEGER, ANY_NUMERICAL, Column_info_t::colNumber, Column_info_t::eType, Column_info_t::name, PGR_DBG, pgr_fetch_column_info(), pgr_fetch_row(), pgr_SPI_cursor_open(), pgr_SPI_prepare(), Column_info_t::strict, time_msg(), and Column_info_t::type.