PANOimagen / profiletool

Home to the QGis Profiletool plugin. Initial work on this fork was partially funded by the C.A. La Rioja
https://plugins.qgis.org/plugins/profiletool/
GNU General Public License v2.0
33 stars 19 forks source link

The profile covers a mcuh longer distance than the layer #60

Closed kobusburger closed 3 years ago

kobusburger commented 3 years ago

The profile generated by version 4.20.0 (obtained via a zip file) covers a much longer distance than the layer. The total line length of the layer is about 99km but the profile tool displays 245km (see image). The red dot following the mouse is also not on the line (see image). The layer (shape format) and profile table (csv) is attached.

Profile.zip image image

nicogodet commented 3 years ago

Is it ok on a previous version of profiletool ?

nicogodet commented 3 years ago

and could you provide the DEM too ?

kobusburger commented 3 years ago

Yes. The I see the same problem with version 3.1.8

nicogodet commented 3 years ago

@kobusburger please share the DEM too

I tested on a DEM I had in stock and a fresh new vector line and profiletool report the correct length

kobusburger commented 3 years ago

I created a small project (attached) and it still gives the problem. The profile is for more than 240km but the layer length is about 99km (screen capture). The cursor is sometimes also no on the line. I tested it on QGIS 3.16.8 LTR.

image Profile test project.zip

nicogodet commented 3 years ago

Ok got it. If you plot with "Selected polyline" instead of "Selected layer", distance is OK.

When you use "Selected layer", iterate on all feature to extract vertices and append them in a list. So first vertex of feature N+1 is just after last vertex of feature N. And profiletool plot the DEM between all vertices. That's why you see on canvas, the red dot not on your polyline.

Example:

Between fid 36 and 38 image

And if you connect all vertices using a strait line image

So it's not a bug to my opinion, just a bad usage of the plugin.

Sorry for the poor english...

kobusburger commented 3 years ago

I think I understand. The lines do not follow each other in the attribute table and therefore the profile is created between vertices that do not have a line between them. If I delete the shorter lines which do not follow each other and just retain the long line segments which do follow each other, then the profile is correct.

kobusburger commented 3 years ago

Can you exclude the the sections that do not follow a line?

nicogodet commented 3 years ago

I would have to guess which line is the main line, order vertices then draw ?

Or use selected polylines instead of selected layer