|
@@ -84,7 +84,7 @@ Vect_net_ttb_build_graph(struct Map_info *Map,
|
|
/*TODO attributes of turntable shoud be stored in one place */
|
|
/*TODO attributes of turntable shoud be stored in one place */
|
|
const char *tcols[] = { "cat", "ln_from", "ln_to", "cost", "isec", NULL
|
|
const char *tcols[] = { "cat", "ln_from", "ln_to", "cost", "isec", NULL
|
|
};
|
|
};
|
|
- dbCatValArray tvarrs[5] = { };
|
|
|
|
|
|
+ dbCatValArray tvarrs[5];
|
|
int tctype[5] = { 0 };
|
|
int tctype[5] = { 0 };
|
|
int tucfield_idx;
|
|
int tucfield_idx;
|
|
|
|
|
|
@@ -687,7 +687,7 @@ Vect_net_ttb_build_graph(struct Map_info *Map,
|
|
\param abcol column with backward costs for arc (if NULL, back costs = forward costs),
|
|
\param abcol column with backward costs for arc (if NULL, back costs = forward costs),
|
|
\param ncol column with costs for nodes (if NULL, do not use node costs),
|
|
\param ncol column with costs for nodes (if NULL, do not use node costs),
|
|
\param geo use geodesic calculation for length (LL),
|
|
\param geo use geodesic calculation for length (LL),
|
|
- \param algorithm not used (in future code for algorithm)
|
|
|
|
|
|
+ \param version graph version to create (1, 2, 3)
|
|
|
|
|
|
\return 0 on success, 1 on error
|
|
\return 0 on success, 1 on error
|
|
*/
|
|
*/
|
|
@@ -698,7 +698,7 @@ Vect_net_build_graph(struct Map_info *Map,
|
|
int nfield,
|
|
int nfield,
|
|
const char *afcol,
|
|
const char *afcol,
|
|
const char *abcol,
|
|
const char *abcol,
|
|
- const char *ncol, int geo, int algorithm)
|
|
|
|
|
|
+ const char *ncol, int geo, int version)
|
|
{
|
|
{
|
|
/* TODO long function, split into smaller ones */
|
|
/* TODO long function, split into smaller ones */
|
|
int i, j, from, to, line, nlines, nnodes, ret, type, cat, skipped, cfound;
|
|
int i, j, from, to, line, nlines, nnodes, ret, type, cat, skipped, cfound;
|
|
@@ -761,11 +761,14 @@ Vect_net_build_graph(struct Map_info *Map,
|
|
Map->dgraph.node_costs[i] = 0;
|
|
Map->dgraph.node_costs[i] = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (version < 1 || version > 3)
|
|
|
|
+ version = 1;
|
|
|
|
+
|
|
if (ncol != NULL)
|
|
if (ncol != NULL)
|
|
- dglInitialize(gr, (dglByte_t) 1, sizeof(dglInt32_t), (dglInt32_t) 0,
|
|
|
|
|
|
+ dglInitialize(gr, (dglByte_t) version, sizeof(dglInt32_t), (dglInt32_t) 0,
|
|
opaqueset);
|
|
opaqueset);
|
|
else
|
|
else
|
|
- dglInitialize(gr, (dglByte_t) 1, (dglInt32_t) 0, (dglInt32_t) 0,
|
|
|
|
|
|
+ dglInitialize(gr, (dglByte_t) version, (dglInt32_t) 0, (dglInt32_t) 0,
|
|
opaqueset);
|
|
opaqueset);
|
|
|
|
|
|
if (gr == NULL)
|
|
if (gr == NULL)
|