Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Feature][Processing] GRASS v.net modules
  • Loading branch information
Médéric Ribreux authored and Médéric RIBREUX committed Jan 2, 2016
1 parent 2eb95f0 commit af01652
Show file tree
Hide file tree
Showing 32 changed files with 1,000 additions and 85 deletions.
2 changes: 2 additions & 0 deletions python/plugins/processing/algs/grass7/CMakeLists.txt
Expand Up @@ -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})
199 changes: 114 additions & 85 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions python/plugins/processing/algs/grass7/description/v.net.alloc.txt
@@ -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
15 changes: 15 additions & 0 deletions python/plugins/processing/algs/grass7/description/v.net.flow.txt
@@ -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
14 changes: 14 additions & 0 deletions python/plugins/processing/algs/grass7/description/v.net.iso.txt
@@ -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
16 changes: 16 additions & 0 deletions python/plugins/processing/algs/grass7/description/v.net.path.txt
@@ -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
11 changes: 11 additions & 0 deletions python/plugins/processing/algs/grass7/description/v.net.txt
@@ -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
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/grass7/ext/CMakeLists.txt
@@ -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.