mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Add v.lrs.create algorithm
This commit is contained in:
parent
3a995cfe8d
commit
db65371e99
@ -0,0 +1,15 @@
|
||||
v.lrs.create
|
||||
Creates Linear Reference System
|
||||
Vector (v.*)
|
||||
ParameterVector|in_lines|Input vector map containing lines|1|False
|
||||
ParameterVector|points|Input vector map containing reference points|0|False
|
||||
ParameterTableField|lidcol|Column containing line identifiers for lines|in_lines|0|False
|
||||
ParameterTableField|pidcol|Column containing line identifiers for points|points|0|False
|
||||
ParameterTableField|start_mp|Column containing milepost position for the beginning of next segment|points|0|False
|
||||
ParameterTableField|start_off|Column containing offset from milepost for the beginning of next segment|points|0|False
|
||||
ParameterTableField|end_mp|Column containing milepost position for the end of previous segment|points|0|False
|
||||
ParameterTableField|end_off|Column containing offset from milepost for the end of previous segment|points|0|False
|
||||
ParameterNumber|thresh|Maximum distance of point to line allowed|0|None|1|True
|
||||
OutputVector|out_lines|LRS lines
|
||||
OutputVector|err|LRS Errors
|
||||
OutputTable|rstable|RS Table
|
44
python/plugins/processing/algs/grass7/ext/v_lrs_create.py
Normal file
44
python/plugins/processing/algs/grass7/ext/v_lrs_create.py
Normal file
@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
***************************************************************************
|
||||
v_lrs_create.py
|
||||
---------------
|
||||
Date : March 2016
|
||||
Copyright : (C) 2016 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__ = 'March 2016'
|
||||
__copyright__ = '(C) 2016, 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):
|
||||
# add some export commands
|
||||
command = 'v.build.all'
|
||||
alg.commands.append(command)
|
||||
|
||||
# export the SQLite table to CSV
|
||||
rstable = alg.getOutputValue('rstable')
|
||||
# I don't use db.out.ogr because it doesn't work
|
||||
command = 'db.select table={} separator=comma output=\"{}\" --overwrite'.format(
|
||||
alg.exportedLayers[rstable],
|
||||
rstable
|
||||
)
|
||||
alg.commands.append(command)
|
||||
alg.processOutputs()
|
Loading…
x
Reference in New Issue
Block a user