78 for (i = 0; i < point_list->
n_values; i++) {
81 point_list->
value[i] = node;
108 int i, nlines, nnodes;
126 for (i = 1; i <= nnodes; i++)
134 for (i = 1; i <= nlines; i++) {
146 node_costs[node] = -1;
175 struct ilist *nodes,
int *nodes_to_features)
177 int nlines, nnodes, i;
182 if (nodes_to_features)
183 for (i = 1; i <= nnodes; i++)
184 nodes_to_features[i] = -1;
186 for (i = 1; i <= nlines; i++) {
196 if (nodes_to_features)
197 nodes_to_features[node] = i;
200 G_warning(
_(
"Point %d is not connected!"), i);
208 if (nodes_to_features)
209 nodes_to_features[node1] = nodes_to_features[node2] = i;
244 G_warning(
_(
"'where' and 'cats' parameters were supplied, cat will be ignored"));
247 G_warning(
_(
"Unable to load data from database"));
254 G_warning(
_(
"Problem loading category values"));
265 for (i = 1; i <= n; i++) {
268 if (!(ltype & mask_type))
int Vect_set_varray_from_cat_string(const struct Map_info *, int, const char *, int, int, struct varray *)
Set values in 'varray' to 'value' from category string.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void db_CatValArray_init(dbCatValArray *)
Initialize dbCatValArray.
plus_t Vect_get_num_nodes(const struct Map_info *)
Get number of nodes in vector map.
plus_t Vect_get_num_lines(const struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
char * table
Name of DB table.
int n_values
Number of values in the list.
dbDriver * db_start_driver_open_database(const char *, const char *)
Open driver/database connection.
#define GV_POINT
Feature types used in memory on run time (may change)
int db_close_database_shutdown_driver(dbDriver *)
Close driver/database connection.
struct field_info * Vect_get_field(const struct Map_info *, int)
Get information about link to database (by layer number)
int Vect_get_node_coor(const struct Map_info *, int, double *, double *, double *)
Get node coordinates.
void NetA_varray_to_nodes(struct Map_info *map, struct varray *varray, struct ilist *nodes, int *nodes_to_features)
Get list of nodes from varray.
Layer (old: field) information.
struct Graph_info dgraph
Graph info (built for network analysis)
double * x
Array of X coordinates.
int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type, char *where, char *cat, struct varray **varray)
Initialize varray.
Feature geometry info - coordinates.
int NetA_get_node_costs(struct Map_info *In, int layer, char *column, int *node_costs)
Get node cost.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_find_node(struct Map_info *, double, double, double, double, int)
Find the nearest node.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
const struct driver * driver
int db_CatValArray_get_value_double(dbCatValArray *, int, double *)
Find value (double) by key.
struct varray * Vect_new_varray(int)
Create new struct varray and allocate space for given number of items.
int Vect_get_line_nodes(const struct Map_info *, int, int *, int *)
Get line nodes.
double * y
Array of Y coordinates.
char * driver
Name of DB driver ('sqlite', 'dbf', ...)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list)
Finds node.
void db_CatValArray_free(dbCatValArray *)
Free allocated dbCatValArray.
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
void G_warning(const char *,...) __attribute__((format(printf
int cost_multip
Edge and node costs multiplicator.
double * z
Array of Z coordinates.
void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node, struct line_cats *Cats)
Writes point.
int * value
Array of values.
int db_select_CatValArray(dbDriver *, const char *, const char *, const char *, const char *, dbCatValArray *)
Select pairs key/value to array, values are sorted by key (must be integer)
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int Vect_cat_get(const struct line_cats *, int, int *)
Get first found category of given field.
void Vect_reset_line(struct line_pnts *)
Reset line.
int Vect_set_varray_from_db(const struct Map_info *, int, const char *, int, int, struct varray *)
Set values in 'varray' to 'value' from DB (where statement)
char * key
Name of key column (usually 'cat')