GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
Vector library - related fns for vector network analyses. More...
Go to the source code of this file.
Functions | |
int | Vect_net_ttb_shortest_path (struct Map_info *Map, int from, int from_type, int to, int to_type, int tucfield, struct ilist *List, double *cost) |
Find shortest path on network. More... | |
int | Vect_net_shortest_path (struct Map_info *Map, int from, int to, struct ilist *List, double *cost) |
Find shortest path. More... | |
dglGraph_s * | Vect_net_get_graph (struct Map_info *Map) |
Get graph structure. More... | |
int | Vect_net_get_line_cost (struct Map_info *Map, int line, int direction, double *cost) |
Returns in cost for given direction in *cost. More... | |
int | Vect_net_get_node_cost (struct Map_info *Map, int node, double *cost) |
Get cost of node. More... | |
int | Vect_net_nearest_nodes (struct Map_info *Map, double x, double y, double z, int direction, double maxdist, int *node1, int *node2, int *ln, double *costs1, double *costs2, struct line_pnts *Points1, struct line_pnts *Points2, double *distance) |
Find nearest node(s) on network. More... | |
int | Vect_net_shortest_path_coor (struct Map_info *Map, double fx, double fy, double fz, double tx, double ty, double tz, double fmax, double tmax, double *costs, struct line_pnts *Points, struct ilist *List, struct ilist *NodesList, struct line_pnts *FPoints, struct line_pnts *TPoints, double *fdist, double *tdist) |
Find shortest path on network between 2 points given by coordinates. More... | |
int | Vect_net_ttb_shortest_path_coor (struct Map_info *Map, double fx, double fy, double fz, double tx, double ty, double tz, double fmax, double tmax, int tucfield, double *costs, struct line_pnts *Points, struct ilist *List, struct ilist *NodesList, struct line_pnts *FPoints, struct line_pnts *TPoints, double *fdist, double *tdist) |
Find shortest path on network with turntable between 2 points given by coordinates. More... | |
Vector library - related fns for vector network analyses.
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.
Definition in file net_analyze.c.
dglGraph_s* Vect_net_get_graph | ( | struct Map_info * | Map | ) |
Get graph structure.
Graph is built by Vect_net_build_graph().
Returns NULL when graph is not built.
Map | pointer to Map_info struct |
Definition at line 397 of file net_analyze.c.
References Map_info::dgraph, and Graph_info::graph_s.
int Vect_net_get_line_cost | ( | struct Map_info * | Map, |
int | line, | ||
int | direction, | ||
double * | cost | ||
) |
Returns in cost for given direction in *cost.
cost is set to -1 if closed.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) | |
line | line id | |
direction | direction (GV_FORWARD, GV_BACKWARD) | |
[out] | cost |
Definition at line 414 of file net_analyze.c.
int Vect_net_get_node_cost | ( | struct Map_info * | Map, |
int | node, | ||
double * | cost | ||
) |
Get cost of node.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) | |
node | node id | |
[out] | cost | costs value |
Definition at line 468 of file net_analyze.c.
References Map_info::dgraph, G_debug(), and Graph_info::node_costs.
int Vect_net_nearest_nodes | ( | struct Map_info * | Map, |
double | x, | ||
double | y, | ||
double | z, | ||
int | direction, | ||
double | maxdist, | ||
int * | node1, | ||
int * | node2, | ||
int * | ln, | ||
double * | costs1, | ||
double * | costs2, | ||
struct line_pnts * | Points1, | ||
struct line_pnts * | Points2, | ||
double * | distance | ||
) |
Find nearest node(s) on network.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) | |
x,y,z | point coordinates (z coordinate NOT USED !) | |
direction | (GV_FORWARD - from point to net, GV_BACKWARD - from net to point) | |
maxdist | maximum distance to the network | |
[out] | node1 | pointer where to store the node number (or NULL) |
[out] | node2 | pointer where to store the node number (or NULL) |
[out] | ln | pointer where to store the nearest line number (or NULL) |
[out] | costs1 | pointer where to store costs on nearest line to node1 (not costs from x,y,z to the line) (or NULL) |
[out] | costs2 | pointer where to store costs on nearest line to node2 (not costs from x,y,z to the line) (or NULL) |
[out] | Points1 | pointer to structure where to store vertices on nearest line to node1 (or NULL) |
[out] | Points2 | pointer to structure where to store vertices on nearest line to node2 (or NULL) |
[out] | pointer | where to distance to the line (or NULL) |
[out] | distance |
Definition at line 499 of file net_analyze.c.
int Vect_net_shortest_path | ( | struct Map_info * | Map, |
int | from, | ||
int | to, | ||
struct ilist * | List, | ||
double * | cost | ||
) |
Find shortest path.
Costs for 'from' and 'to' nodes are not considered (SP found even if 'from' or 'to' are 'closed' (costs = -1) and costs of these nodes are not added to SP costs result.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) | |
from | from node | |
to | to node | |
[out] | List | list of line ids (path) |
[out] | cost | costs value |
Definition at line 380 of file net_analyze.c.
int Vect_net_shortest_path_coor | ( | struct Map_info * | Map, |
double | fx, | ||
double | fy, | ||
double | fz, | ||
double | tx, | ||
double | ty, | ||
double | tz, | ||
double | fmax, | ||
double | tmax, | ||
double * | costs, | ||
struct line_pnts * | Points, | ||
struct ilist * | List, | ||
struct ilist * | NodesList, | ||
struct line_pnts * | FPoints, | ||
struct line_pnts * | TPoints, | ||
double * | fdist, | ||
double * | tdist | ||
) |
Find shortest path on network between 2 points given by coordinates.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) |
fx,fy,fz | from point x coordinate (z ignored) |
tx,ty,tz | to point x coordinate (z ignored) |
fmax | maximum distance to the network from 'from' |
tmax | maximum distance to the network from 'to' |
costs | pointer where to store costs on the network (or NULL) |
Points | pointer to the structure where to store vertices of shortest path (or NULL) |
List | pointer to the structure where list of lines on the network is stored (or NULL) |
NodesList | pointer to the structure where list of nodes on the network is stored (or NULL) |
FPoints | pointer to the structure where to store line from 'from' to first network node (or NULL) |
TPoints | pointer to the structure where to store line from last network node to 'to' (or NULL) |
fdist | distance from 'from' to the net (or NULL) |
tdist | distance from 'to' to the net (or NULL) |
Definition at line 1016 of file net_analyze.c.
int Vect_net_ttb_shortest_path | ( | struct Map_info * | Map, |
int | from, | ||
int | from_type, | ||
int | to, | ||
int | to_type, | ||
int | tucfield, | ||
struct ilist * | List, | ||
double * | cost | ||
) |
Find shortest path on network.
Costs for 'from' and 'to' nodes are not considered (SP found even if 'from' or 'to' are 'closed' (costs = -1) and costs of these nodes are not added to SP costs result.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) | |
from | start of the path | |
from_type | if 0 - node id (intersection), if 1 - line unique cat | |
to | end of the path | |
to_type | if 0 - node id (intersection), if 1 - line unique cat | |
tucfield | field with unique categories used in the turntable | |
[out] | List | list of line ids (path) |
[out] | cost | costs value |
Definition at line 260 of file net_analyze.c.
int Vect_net_ttb_shortest_path_coor | ( | struct Map_info * | Map, |
double | fx, | ||
double | fy, | ||
double | fz, | ||
double | tx, | ||
double | ty, | ||
double | tz, | ||
double | fmax, | ||
double | tmax, | ||
int | tucfield, | ||
double * | costs, | ||
struct line_pnts * | Points, | ||
struct ilist * | List, | ||
struct ilist * | NodesList, | ||
struct line_pnts * | FPoints, | ||
struct line_pnts * | TPoints, | ||
double * | fdist, | ||
double * | tdist | ||
) |
Find shortest path on network with turntable between 2 points given by coordinates.
Map | vector map with build graph (see Vect_net_ttb_build_graph and Vect_net_build_graph) |
fx,fy,fz | from point x coordinate (z ignored) |
tx,ty,tz | to point x coordinate (z ignored) |
fmax | maximum distance to the network from 'from' |
tmax | maximum distance to the network from 'to' |
tucfield | field with unique categories used in the turntable |
costs | pointer where to store costs on the network (or NULL) |
Points | pointer to the structure where to store vertices of shortest path (or NULL) |
List | pointer to the structure where list of lines on the network is stored (or NULL) |
NodesList | pointer to the structure where list of nodes on the network is stored (or NULL) |
FPoints | pointer to the structure where to store line from 'from' to first network node (or NULL) |
TPoints | pointer to the structure where to store line from last network node to 'to' (or NULL) |
fdist | distance from 'from' to the net (or NULL) |
tdist | distance from 'to' to the net (or NULL) |
Definition at line 1052 of file net_analyze.c.