I want to order a sequence of points along a polyline. I find solutions at this post and this one. They suggested to use line_locate_point() to identify the distance from each point in a point layer to the start point of an existing polyline layer:
line_locate_point (geometry:=geometry(get_feature('polyline', 'id', 939)), point:= $geometry)
in my case, 939 is the "id" of first link of the polyline layer.
However the code returns all 0s or same value group.
The polyline shapefile and the point shapefile are in the same geographic coordinate system. I also tried project both shapefiles to the same coordinate system that has meter as the units. However, the results are either all 0s, or same value group, as shown in the picture below. the returned results are in the last column with two values:818 and 0.
The polyline layer is connected. Shortest path algorithm can find a route from the beginning point to the end point of the polyline.





