[Qgis-user] Batch selection/new feature creation

Samuel Williams sam.williams at sineenvironmental.com
Thu Sep 17 02:13:42 PDT 2020


Hello,
I'm hoping that those with more experience of QIS might be able to help
point me in the right direction.
I have a layer consisting of around 700 end-to-end polylines, each of which
represents a 100m stretch of railway track centreline. Each polyline is
attributed with an integer value which represents its starting chainage
(distance in m from the start of the railway line, abbreviated ch.).
I also have a spreadsheet/csv with several hundred rows, each of which
represents a different section of the railway. These sections are defined
by their start and end chainage (e.g. ch. 1300 to ch. 1800 would be a 500m
stretch starting 1300m from the beginning of the line).
I am looking for an efficient way to select each of the polylines
associated with each row in the spreadsheet, dissolve them (they should
touch end to end), and then save them as a new feature on an existing
layer. Each one will need to be given a reference ID from the relevant line
in the spreadsheet.
E.g.
Row 1 of spreadsheet selects all polylines with a starting chainage 1300 to
1700 (which with 100m segments selects the whole length 1300-1800),
 dissolves them, populates the ID field from a field in the spreadsheet, and
finally saves these resulting new feature to an existing layer.
This process would then repeat for the other rows in the spreadsheet/csv.
I’ve got a reasonable understanding of python,  but have never tried using
it within qgis. Would that be the easiest route, or is there a way of using
v.extract in batch mode which reads each of the required selections from the
spreadsheet? From the grass manual v.extract appears to read selections
from a text file, but I can't find any good examples, or detail in the
manual on the required format for the text file.
Any help much appreciated!

Kind regards,


Sam.

Sam Williams

Director | *Sine Acoustics*
m. +447969123431 <%2B44%207969%20123431>|Sam.Williams at sineenvironmental.com
| www.sineenvironmental.com
Sine Acoustics is a trading name of Sine Environmental Limited, company
number 9609805. Postal address: 78 Old Church Road, Clevedon, North
Somerset, England, BS216PT.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200917/b576d638/attachment.html>


More information about the Qgis-user mailing list