I have a Shapefile of road that I have converted from a KML file (created on Google Earth) and a txt file containing lat long (from GPS) of points with some attributes. The points are not exactly on the line layer but are very close.

How can I get the chainage of all points from the first point using LRS?

There is an answer given earlier but I have not understood what are the lines route field, points route field and measure field in my layers. I tried to read several notes but to no avail.

Can someone kindly explain? I can send my layer files if needed.

  • 1
    I'm assuming by LRS you mean linear referencing system. Can you provide a link to the 'answer given earlier'? That may assist in answering your question. Please use the edit button at the lower left to modify your question. – Chris W Feb 10 '15 at 20:36

As I explained in Snap points to line and calculate chainage using Open source GIS the QGIS LRS plugin accepts points not lying on the line to calibrate it, so it's not a problem that your points are not on the line. By the way, I assume you already loaded the txt file as a point layer (say gps_layer).

As you may have already read, you first need to calibrate your route. Such calibration enables you to calculate measures on your route.

I will try to explain once more the parameters you need to calibrate your route based on a couple (start and end) of points. You can create such couple of points digitizing the start and end nodes of the route and saving it to a calibration layer which also contains the measures you assign to each point. For instance, start point would have a measure of 0 and your end point would have a measure of 10000 (if your route is 10Km long).

Once you do that, you will use both the route layer and the calibration layer, this way:

enter image description here

  • Lines layer: The input line layer which contains your route (This would be the layer you obtained after exporting from the KML file).

  • Lines route field: This is a field on the route layer whose value specifies an ID for the route (say 'route1').

  • Points layer: The calibration layer with the couple of points (start and end nodes) you created.

  • Points route field: This is a field in the calibration (point) layer whose value matches the ID of the route (we said 'route1').

  • Measure field: The field name of the measure you set for your points (remember you set 0 for the start point and 10000 for your end point).

  • Measure unit: I've used meters in the example.

Once your route is calibrated, you can use the Measures tab in the plugin GUI and load your gps_layer, you find how to use such functionality in my answer to How to find Chainage of points using QGIS (Numeral 2.)

I hope it's clear now. If it's not, try to ask something more specific (after a first try from your side).

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.