Skip to content
Permalink
Browse files

[Feature][Processing] GRASS v.net modules

  • Loading branch information
Médéric Ribreux Médéric RIBREUX
Médéric Ribreux authored and Médéric RIBREUX committed Jan 2, 2016
1 parent 2eb95f0 commit af0165265014e165aa12bcd3817fec0c7ae2bdf1
Showing with 1,000 additions and 85 deletions.
  1. +2 −0 python/plugins/processing/algs/grass7/CMakeLists.txt
  2. +114 −85 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  3. +13 −0 python/plugins/processing/algs/grass7/description/v.net.alloc.txt
  4. +13 −0 python/plugins/processing/algs/grass7/description/v.net.allpairs.txt
  5. +8 −0 python/plugins/processing/algs/grass7/description/v.net.bridge.txt
  6. +17 −0 python/plugins/processing/algs/grass7/description/v.net.centrality.txt
  7. +10 −0 python/plugins/processing/algs/grass7/description/v.net.components.txt
  8. +14 −0 python/plugins/processing/algs/grass7/description/v.net.connectivity.txt
  9. +18 −0 python/plugins/processing/algs/grass7/description/v.net.distance.txt
  10. +15 −0 python/plugins/processing/algs/grass7/description/v.net.flow.txt
  11. +14 −0 python/plugins/processing/algs/grass7/description/v.net.iso.txt
  12. +16 −0 python/plugins/processing/algs/grass7/description/v.net.path.txt
  13. +13 −0 python/plugins/processing/algs/grass7/description/v.net.salesman.txt
  14. +7 −0 python/plugins/processing/algs/grass7/description/v.net.spanningtree.txt
  15. +12 −0 python/plugins/processing/algs/grass7/description/v.net.steiner.txt
  16. +11 −0 python/plugins/processing/algs/grass7/description/v.net.txt
  17. +7 −0 python/plugins/processing/algs/grass7/description/v.net.visibility.txt
  18. +3 −0 python/plugins/processing/algs/grass7/ext/CMakeLists.txt
  19. 0 TODO → python/plugins/processing/algs/grass7/ext/__init__.py
  20. +188 −0 python/plugins/processing/algs/grass7/ext/v_net.py
  21. +31 −0 python/plugins/processing/algs/grass7/ext/v_net_alloc.py
  22. +31 −0 python/plugins/processing/algs/grass7/ext/v_net_allpairs.py
  23. +33 −0 python/plugins/processing/algs/grass7/ext/v_net_bridge.py
  24. +46 −0 python/plugins/processing/algs/grass7/ext/v_net_components.py
  25. +49 −0 python/plugins/processing/algs/grass7/ext/v_net_connectivity.py
  26. +91 −0 python/plugins/processing/algs/grass7/ext/v_net_distance.py
  27. +50 −0 python/plugins/processing/algs/grass7/ext/v_net_flow.py
  28. +31 −0 python/plugins/processing/algs/grass7/ext/v_net_iso.py
  29. +31 −0 python/plugins/processing/algs/grass7/ext/v_net_path.py
  30. +49 −0 python/plugins/processing/algs/grass7/ext/v_net_salesman.py
  31. +31 −0 python/plugins/processing/algs/grass7/ext/v_net_steiner.py
  32. +32 −0 python/plugins/processing/algs/grass7/ext/v_net_visibility.py
@@ -2,5 +2,7 @@ FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES grass7.txt)
FILE(GLOB DESCR_FILES description/*.txt)

ADD_SUBDIRECTORY(ext)

PLUGIN_INSTALL(processing algs/grass7 ${PY_FILES} ${OTHER_FILES})
PLUGIN_INSTALL(processing algs/grass7/description ${DESCR_FILES})

Large diffs are not rendered by default.

@@ -0,0 +1,13 @@
v.net.alloc
Allocates subnets for nearest centers (direction from center)
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterString|center_cats|Category values|1-100000|False|False
*ParameterSelection|arc_type|Arc type|line;boundary;line,boundary|2
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Alloc
@@ -0,0 +1,13 @@
v.net.allpairs
Computes the shortest path between all pairs of nodes in the network
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterString|cats|Category values|1-10000|False|False
*ParameterString|where|WHERE condition of SQL statement without 'where' keyword'||True|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Allpairs
@@ -0,0 +1,8 @@
v.net.bridge
Computes bridges and articulation points in the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterSelection|method|Operation to be performed|bridge;articulation|0|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (name)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (name)|input|0|True
OutputVector|output|Bridge_Or_Articulation
@@ -0,0 +1,17 @@
v.net.centrality
Computes degree, centrality, betweeness, closeness and eigenvector centrality measures in the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterString|degree|Name of degree centrality column|degree|False|True
ParameterString|closeness|Name of closeness centrality column|closeness|False|True
ParameterString|betweenness|Name of betweenness centrality column||False|True
ParameterString|eigenvector|Name of eigenvector centrality column||False|True
*ParameterNumber|iterations|Maximum number of iterations to compute eigenvector centrality|1|None|1000|True
*ParameterNumber|error|Cumulative error tolerance for eigenvector centrality|0.001|None|0.1|True
*ParameterString|cats|Category values||False|True
*ParameterString|where|WHERE conditions of SQL statement without 'where' keyword||True|True
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterBoolean|-a|Add points on nodes|True|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Centrality
@@ -0,0 +1,10 @@
v.net.components
Computes strongly and weakly connected components in the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterSelection|method|Type of components|weak;strong|0|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterBoolean|-a|Add points on nodes|True|True
OutputVector|output|Network_Components_Line
OutputVector|output_point|Network_Components_Point
@@ -0,0 +1,14 @@
v.net.connectivity
Computes vertex connectivity between two sets of nodes in the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterVector|points|Input vector point layer (first set of nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
ParameterString|set1_cats|Set1 Category values||False|True
ParameterString|set1_where|Set1 WHERE conditions of SQL statement without 'where' keyword||True|True
ParameterString|set2_cats|Set2 Category values||False|True
ParameterString|set2_where|Set2 WHERE conditions of SQL statement without 'where' keyword||True|True
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
OutputVector|output|Network_Connectivity
@@ -0,0 +1,18 @@
v.net.distance
Computes shortest distance via the network between the given sets of features.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterVector|from_points|Input vector point layer (from)|0|False
ParameterVector|to_points|Input vector point layer (to)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterSelection|arc_type|Arc type|line;boundary;line,boundary|2
*ParameterString|from_cats|From Category values||False|True
*ParameterString|from_where|From WHERE conditions of SQL statement without 'where' keyword||True|True
*ParameterSelection|to_type|To feature type|point;line;boundary|0
*ParameterString|to_cats|To Category values||False|True
*ParameterString|to_where|To WHERE conditions of SQL statement without 'where' keyword||True|True
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|from_points|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Distance
@@ -0,0 +1,15 @@
v.net.flow
Computes the maximum flow between two sets of nodes in the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (network)|1|False
ParameterVector|points|Input vector point layer (flow nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
ParameterString|source_cats|Source Category values||False|True
ParameterString|source_where|Source WHERE conditions of SQL statement without 'where' keyword||True|True
ParameterString|sink_cats|Sink Category values||False|True
ParameterString|sink_where|Sink WHERE conditions of SQL statement without 'where' keyword||True|True
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
OutputVector|output|Network_Flow
OutputVector|cut|Network_Cut
@@ -0,0 +1,14 @@
v.net.iso
Splits network by cost isolines.
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterSelection|arc_type|Arc type|line;boundary;line,boundary|2
*ParameterString|center_cats|Category values|1-100000|False|False
ParameterString|costs|Costs for isolines|1000,2000,3000|False|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Iso
@@ -0,0 +1,16 @@
v.net.path
Finds shortest path on vector network
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterFile|file|Name of file containing start and end points|False|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterSelection|type|Arc type|line;boundary;line,boundary|2
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterTableField|node_column|Node cost column (number)|points|0|True
*ParameterNumber|dmax|Maximum distance to the network|None|None|1000.0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
*ParameterBoolean|-s|Write output as original input segments, not each path as one line|False|True
OutputVector|output|Network_Path

@@ -0,0 +1,13 @@
v.net.salesman
Creates a cycle connecting given nodes (Traveling salesman problem)
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterSelection|arc_type|Arc type|line;boundary;line,boundary|2
*ParameterString|center_cats|Category values|1-100000|False|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterTableField|arc_backward_column|Arc backward direction cost column (number)|input|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Salesman
OutputTable|sequence|Salesman_Nodes_Sequence
@@ -0,0 +1,7 @@
v.net.spanningtree
Computes minimum spanning tree for the network.
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
*ParameterTableField|arc_column|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|SpanningTree
@@ -0,0 +1,12 @@
v.net.steiner
Creates Steiner tree for the network and given terminals
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Centers point layer (nodes)|0|False
ParameterNumber|threshold|Threshold for connecting centers to the network (in map unit)|0.0|None|50.0|False
*ParameterSelection|arc_type|Arc type|line;boundary;line,boundary|2
*ParameterString|terminal_cats|Category values|1-100000|False|False
*ParameterTableField|acolumn|Arc forward/both direction(s) cost column (number)|input|0|True
*ParameterNumber|npoints|Maximum distance to the network|None|None|-1|True
*ParameterBoolean|-g|Use geodesic calculation for longitude-latitude locations|False|True
OutputVector|output|Network_Steiner
@@ -0,0 +1,11 @@
v.net
Performs network maintenance
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|1|False
ParameterVector|points|Input vector point layer (nodes)|0|True
ParameterFile|file|Name of input file (required for operation 'arcs')|False|True
ParameterSelection|operation|Operation to be performed|nodes;connect;arcs;report;nreport|1
ParameterNumber|threshold|Threshold (for operation 'connect')|None|None|50.0
*ParameterBoolean|-c|Assign unique categories to new points (for operation 'nodes')|False|True
*ParameterBoolean|-s|Snap points to network (for operation 'connect')|False|True
OutputVector|output|Network
@@ -0,0 +1,7 @@
v.net.visibility
Performs visibility graph construction.
Vector (v.*)
ParameterVector|input|Input vector line layer (arcs)|-1|False
*ParameterString|coordinates|Coordinates||False|True
*ParameterVector|visibility|Input vector line layer containing visable points|1|True
OutputVector|output|Network_Visibility
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

PLUGIN_INSTALL(processing algs/grass7/ext ${PY_FILES})
File renamed without changes.

0 comments on commit af01652

Please sign in to comment.
You can’t perform that action at this time.