Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Non variable output version. Adds:
* v.net.arcs for v.net 'arcs' operation. * v.net.articulation for v.net.brdige 'articulation' method. * v.net.connect for v.net 'connect' operation. * v.net.nodes for v.net 'nodes' operation. * v.net.nreport for v.net 'nreport' operation. * v.net.report for v.net 'report operation. * Some code simplification.
- Loading branch information
Médéric RIBREUX
committed
Jan 9, 2016
1 parent
14a6115
commit 85b87d5
Showing
21 changed files
with
218 additions
and
125 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/grass7/description/v.net.arcs.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
v.net | ||
v.net.arcs - Creates arcs from a file of points | ||
Vector (v.*) | ||
ParameterVector|points|Input vector point layer (nodes)|0|False | ||
ParameterFile|file|Name of input arcs file|False|False | ||
Hardcoded|operation=arcs | ||
OutputVector|output|Arcs |
8 changes: 8 additions & 0 deletions
8
python/plugins/processing/algs/grass7/description/v.net.articulation.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
v.net.bridge | ||
v.net.articulation - Computes articulation points in the network | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (network)|1|False | ||
Hardcoded|method=articulation | ||
*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|Articulation |
6 changes: 3 additions & 3 deletions
6
python/plugins/processing/algs/grass7/description/v.net.bridge.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
v.net.bridge | ||
Computes bridges and articulation points in the network. | ||
Computes bridges in the network. | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (network)|1|False | ||
ParameterSelection|method|Operation to be performed|bridge;articulation|0|False | ||
Hardcoded|method=bridge | ||
*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 | ||
OutputVector|output|Bridge |
9 changes: 9 additions & 0 deletions
9
python/plugins/processing/algs/grass7/description/v.net.connect.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
v.net | ||
v.net.connect - Connects points to nearest arcs in a network | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (arcs)|1|False | ||
ParameterVector|points|Input vector point layer (nodes)|0|False | ||
Hardcoded|operation=connect | ||
ParameterNumber|threshold|Threshold for connection distance|None|None|50.0 | ||
*ParameterBoolean|-s|Snap points to network|False | ||
OutputVector|output|Network |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/grass7/description/v.net.nodes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
v.net | ||
v.net.nodes - Creates points for each network arcs | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (arcs)|1|False | ||
Hardcoded|operation=nodes | ||
*ParameterBoolean|-c|Assign unique categories to new points (for operation 'nodes')|False | ||
OutputVector|output|Nodes |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/grass7/description/v.net.nreport.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
v.net | ||
v.net.nreport - Reports nodes information of a network | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (arcs)|1|False | ||
Hardcoded|operation=nreport | ||
OutputFile|output|NReport | ||
|
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/grass7/description/v.net.report.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
v.net | ||
v.net.report - Reports lines information of a network | ||
Vector (v.*) | ||
ParameterVector|input|Input vector line layer (arcs)|1|False | ||
Hardcoded|operation=report | ||
OutputFile|output|Report | ||
|
11 changes: 0 additions & 11 deletions
11
python/plugins/processing/algs/grass7/description/v.net.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
|
||
__revision__ = '$Format:%H$' | ||
|
||
|
||
from v_net import incorporatePoints | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
v_net_arcs.py | ||
--------------------- | ||
Date : December 2015 | ||
Copyright : (C) 2015 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'December 2015' | ||
__copyright__ = '(C) 2015, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
from v_net import variableOutput | ||
|
||
|
||
def processOutputs(alg): | ||
outputParameter = {u"output": [u"line", 1]} | ||
variableOutput(alg, outputParameter) |
33 changes: 33 additions & 0 deletions
33
python/plugins/processing/algs/grass7/ext/v_net_articulation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
v_net_articulation.py | ||
--------------------- | ||
Date : December 2015 | ||
Copyright : (C) 2015 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'December 2015' | ||
__copyright__ = '(C) 2015, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
from v_net import variableOutput | ||
|
||
|
||
def processOutputs(alg): | ||
outputParameter = {u"output": [u"point", 1]} | ||
variableOutput(alg, outputParameter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
python/plugins/processing/algs/grass7/ext/v_net_connect.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
v_net_connect.py | ||
--------------------- | ||
Date : December 2015 | ||
Copyright : (C) 2015 by Médéric Ribreux | ||
Email : medspx at medspx dot fr | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Médéric Ribreux' | ||
__date__ = 'December 2015' | ||
__copyright__ = '(C) 2015, Médéric Ribreux' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
import os | ||
|
||
|
||
def processOutputs(alg): | ||
out = alg.getOutputValue(u"output") | ||
command = u"v.out.ogr -c type=line layer=1 -e input={} output=\"{}\" format=ESRI_Shapefile output_layer={}".format( | ||
alg.exportedLayers[out], | ||
os.path.dirname(out), | ||
os.path.basename(out)[:-4] | ||
) | ||
alg.commands.append(command) | ||
alg.outputCommands.append(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.