I have a table with distances in a line in meters.


I need to create points along this line in the distance from the start, as specified, using QGIS.

My doubt is similar to this Plot points along a line at specific distance value?, but the PyQGIS code didn't work.

  • 1
    Welcome to GIS SE! As a new user be sure to take the Tour to learn about the site and its protocols. By asking how to do the same thing in either of two products you are effectively asking two questions which makes this too broad. To avoid that I removed ArcMap from your question. If you wish to also ask about that then please do so in a separate question.
    – PolyGeo
    May 27, 2019 at 4:59

3 Answers 3


In QGIS2 you can do it like this:

1) open the field calculator and add a new field with $length
2) open attribute table and copy newly created value
3) use "Create points along lines (GDAL/OGR)" with 3110/value etc. (using the $length function instead of copying the value didn't work for me here)

If you need to automate the process, try this (QGIS2.18):

import csv
from qgis.utils import *
import processing

#paths for csv input with distances and output folder for shapefile

#access active layer (line shape) and calculate its length
layer = iface.activeLayer()
features = layer.getFeatures()
for f in features:
    geom = f.geometry()
    length = geom.length()

#read csv with specified distances
with open(path_distances_csv, 'rb') as f:
    reader = csv.reader(f)
    for row in reader:

#create points at specified distances
for distance in list_dist:

#create string so that points at specified distances can be merged
output_list = [str(output_list[i]["OUTPUT_LAYER"]) for i in range(len(output_list))]

#merge points into single shapefile

The only thing you need to do is to change the paths for the csv input and output folder as well as load your line in QGIS.


I don't know an efficient way; if your distance is multiples of five (5) this approach may be an option.

(1) Create points along the line at equal interval (5 meters starting from 3110m).

enter image description here

(2) Select points of matching distance. (either by eyeballing them or using get_feature() expressions etc.).


There is a plugin called QChainage that can do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.