TransWikia.com

QGIS 3x automeasure distance for all lines in the layer

Geographic Information Systems Asked on January 16, 2021

I have got 2 lines in my layer. I would like to measure their distance automatically.

I found the tool, which might be helpful. This is the v.distance algorithm in GRASS, as advised in the link below:

QGIS calculate distance of point along a line

My data attribute table looks like this by far:

enter image description here

and I would like to have the distance for all of them in the Length [meters] column.

I tried the v.distance GRASS plugin, but the situation looks as follows:

enter image description here

I am getting an error:

Wrong or missing parameter value: Column name(s) where values specified by
'upload' option will be uploaded

and I don’t really know what to do with it.

I found some similar problem, where the v.distance algorithm also didn’t work properly,

GRASS v.distance in QGIS not working

but they suggest changing the code in Python section. Is it still needed?

Is there any way to autocalculate the distance for all line features available in the given layer?

One Answer

Am I right in thinking that you want to populate that field with the length of the lines? If so then in the field calculator you would use the expression $length. This is assuming that the layer is in the correct coordinate reference system. If the output has too many decimal places then you can use the expression ROUND($length, x) where x is the number of decimal places you want.

If you want that field to calculate automatically on the fly as you edit the layer, then you need to create a virtual field in the field calculator using the same expression.

Answered by TeddyTedTed on January 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP