Thursday 23 January 2020

python - Splitting line every x meters using QGIS?




I have a line that I ultimately want to split up into points. The points should be every 100 meter along the line. So I don't want to extract the nodes.


Are there any Open Source (QGIS, Python) tools around for that?


The use case is that I have a bus line without bus stops. Though I know every 100 meter the bus stops. This way I want to generate bus stops to use as a GTFS feed.



Answer



You can use the Convert lines to points tool (you need SAGA GIS installed and the processing toolbox plugin enabled) and set your distance:


Convert lines to points


This is what I received for my line layer:


Line and points


I used the Measure Line tool from the toolbar to do a quick check between points:


Measured line



Hope this helps!


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...