GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
net_build.c File Reference

Vector library - related fns for vector network building. More...

#include <grass/dbmi.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for net_build.c:

Go to the source code of this file.

Functions

int Vect_net_ttb_build_graph (struct Map_info *Map, int ltype, int afield, int nfield, int tfield, int tucfield, const char *afcol, const char *abcol, const char *ncol, int geo, int algorithm UNUSED)
 Build network graph with turntable. More...
 
int Vect_net_build_graph (struct Map_info *Map, int ltype, int afield, int nfield, const char *afcol, const char *abcol, const char *ncol, int geo, int version)
 Build network graph. More...
 

Detailed Description

Vector library - related fns for vector network building.

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2009, 2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Radim Blazek
Stepan Turek stepan.turek seznam.cz (turns support)

Definition in file net_build.c.

Function Documentation

◆ Vect_net_build_graph()

int Vect_net_build_graph ( struct Map_info Map,
int  ltype,
int  afield,
int  nfield,
const char *  afcol,
const char *  abcol,
const char *  ncol,
int  geo,
int  version 
)

Build network graph.

Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000 and for lengths LL without geo flag by

  1. The same multiplication factor is used for nodes. Costs in database column may be 'integer' or 'double precision' number >= 0 or -1 for infinity i.e. arc or node is closed and cannot be traversed If record in table is not found for arcs, arc is skip. If record in table is not found for node, costs for node are set to 0.
Parameters
Mapvector map
ltypeline type for arcs
afieldarc costs field (if 0, use length)
nfieldnode costs field (if 0, do not use node costs)
afcolcolumn with forward costs for arc
abcolcolumn with backward costs for arc (if NULL, back costs = forward costs),
ncolcolumn with costs for nodes (if NULL, do not use node costs),
geouse geodesic calculation for length (LL),
versiongraph version to create (1, 2, 3)
Returns
0 on success, 1 on error

Definition at line 695 of file net_build.c.

◆ Vect_net_ttb_build_graph()

int Vect_net_ttb_build_graph ( struct Map_info Map,
int  ltype,
int  afield,
int  nfield,
int  tfield,
int  tucfield,
const char *  afcol,
const char *  abcol,
const char *  ncol,
int  geo,
int algorithm  UNUSED 
)

Build network graph with turntable.

Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000 and for lengths LL without geo flag by

  1. The same multiplication factor is used for nodes. Costs in database column may be 'integer' or 'double precision' number >= 0 or -1 for infinity i.e. arc or node is closed and cannot be traversed If record in table is not found for arcs, costs for arc are set to 0. If record in table is not found for node, costs for node are set to 0.
Parameters
Mapvector map
ltypeline type for arcs
afieldarc costs field (if 0, use length)
nfieldnode costs field (if 0, do not use node costs)
tfieldfield where turntable is attached
tucfieldfield with unique categories used in the turntable
afcolcolumn with forward costs for arc
abcolcolumn with backward costs for arc (if NULL, back costs = forward costs)
ncolcolumn with costs for nodes (if NULL, do not use node costs)
geouse geodesic calculation for length (LL)
algorithmnot used (in future code for algorithm)
Returns
0 on success, 1 on error

Definition at line 49 of file net_build.c.