I am looking to generate points along a series of connected lines at regular intervals, but I wish to keep this interval even when a line is branching into 2 or 3 other lines. All the regular tools I tested in ArcMap or QGIS generate points on a feature basis meaning that the interval restart at each node.

On the picture I drew road network (blue lines), direction flow (orange arrows) and desired points (red dots). The first point is at 50m from the beginning of the first line, then a second 50m further but then there is a node within the next 50m. The usual tools would then start "fresh" on the two branches but I want to keep the 50m distance between the last point before the node and the first point on each branch. How could this be done? I suppose some topology may be needed...

Desired points along lines

I am looking for a free solution, ideally with Python, QGIS, SAGA, GRASS, GDAL or alike. In last resort, I could use ArcMap.

  • To solve this problem, you need to prepare the source data, this means for your example, 1) create objects - lines AB and AC and 2) divide them into equal parts ... – Cyril Mar 21 at 10:36

Calculate distance to outlet (using network analyst, maybe. I used networkx) for every node:

enter image description here

Transfer this info into links table:

enter image description here

Create routes - linear referencing:

arcpy.CreateRoutes_lr(in_line_features="LINKS", route_id_field="Route", out_feature_class="C:/SCRATCH/SCRATCH.gdb/ROUTES", measure_source="TWO_FIELDS", from_measure_field="From_T", to_measure_field="To_T", coordinate_priority="UPPER_LEFT", measure_factor="1", measure_offset="0", ignore_gaps="IGNORE", build_index="INDEX")

Note fields I used in above (!).

Create table like that in Excel to cover longest segment:

enter image description here

Add text field aLink to Routes, populate it by "A" and index that field. Use create query table to multiply records from Excel table:

arcpy.MakeQueryTable_management(in_table="ROUTES;fromExcel", out_table="QueryTable3", in_key_field_option="ADD_VIRTUAL_KEY_FIELD", in_key_field="", in_field="", where_clause="ROUTES.aLink = fromExcel.R")

and create event layer using Routes and extended table:

enter image description here


I suggest to use v.to.points (this will create points at a specified distance along your input lines in new vector map)

Note that the distance between generated points will be in map units.

  • It is not ArcGis (a) and how does it handle branching issue (b) ? – FelixIP Mar 21 at 3:45
  • I just tested GRASS v.to.points but it doesn't handle branching nor does it use a regular interval on all features, only within each feature. – Jean-François Bourdon Mar 21 at 12:59

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.