File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
python/plugins/processing/algs/grass7 Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ v.lrs.create
2
+ Creates Linear Reference System
3
+ Vector (v.*)
4
+ ParameterVector|in_lines|Input vector map containing lines|1|False
5
+ ParameterVector|points|Input vector map containing reference points|0|False
6
+ ParameterTableField|lidcol|Column containing line identifiers for lines|in_lines|0|False
7
+ ParameterTableField|pidcol|Column containing line identifiers for points|points|0|False
8
+ ParameterTableField|start_mp|Column containing milepost position for the beginning of next segment|points|0|False
9
+ ParameterTableField|start_off|Column containing offset from milepost for the beginning of next segment|points|0|False
10
+ ParameterTableField|end_mp|Column containing milepost position for the end of previous segment|points|0|False
11
+ ParameterTableField|end_off|Column containing offset from milepost for the end of previous segment|points|0|False
12
+ ParameterNumber|thresh|Maximum distance of point to line allowed|0|None|1|True
13
+ OutputVector|out_lines|LRS lines
14
+ OutputVector|err|LRS Errors
15
+ OutputTable|rstable|RS Table
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """
4
+ ***************************************************************************
5
+ v_lrs_create.py
6
+ ---------------
7
+ Date : March 2016
8
+ Copyright : (C) 2016 by Médéric Ribreux
9
+ Email : medspx at medspx dot fr
10
+ ***************************************************************************
11
+ * *
12
+ * This program is free software; you can redistribute it and/or modify *
13
+ * it under the terms of the GNU General Public License as published by *
14
+ * the Free Software Foundation; either version 2 of the License, or *
15
+ * (at your option) any later version. *
16
+ * *
17
+ ***************************************************************************
18
+ """
19
+
20
+ __author__ = 'Médéric Ribreux'
21
+ __date__ = 'March 2016'
22
+ __copyright__ = '(C) 2016, Médéric Ribreux'
23
+
24
+ # This will get replaced with a git SHA1 when you do a git archive
25
+
26
+ __revision__ = '$Format:%H$'
27
+
28
+ import os
29
+
30
+
31
+ def processOutputs (alg ):
32
+ # add some export commands
33
+ command = 'v.build.all'
34
+ alg .commands .append (command )
35
+
36
+ # export the SQLite table to CSV
37
+ rstable = alg .getOutputValue ('rstable' )
38
+ # I don't use db.out.ogr because it doesn't work
39
+ command = 'db.select table={} separator=comma output=\" {}\" --overwrite' .format (
40
+ alg .exportedLayers [rstable ],
41
+ rstable
42
+ )
43
+ alg .commands .append (command )
44
+ alg .processOutputs ()
You can’t perform that action at this time.
0 commit comments