mauroalberti / qProf

Python plugin for QGIS, to create topographic and geological profiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incorrect prof_id assignment if generating over a threshold number of profiles from polyline shapefile?

wobrotson opened this issue · comments

Hello, I have been trying to process a poly-line shapefile in QGIS using your plugin. The first time I ran the plugin, the profile had 106 lines. I specified the line order field as 'id', an integer feature class running from 1 - 106, and processing worked as expected, with each profile (when plotted in matlab from an exported csv file) corresponding to that drawn using the 'Profile' plugin in QGIS. I then performed the same analysis on other polyline shapefiles with 38 and 76 features respectively, again with success.

Later, I came to add further features to the initial polyline shapefile so that rather than having 106 it now had 301 features. I extracted the profiles again using qProf plugin, and the feature incorrectly assigned the id of the features, so that in the csv file the profiles generated no longer matched those specified in the 'id' feature class of the initial polyline shapefile. I plotted a shapefile of the same data generated by qprof and there seemed to be no pattern to the assignment of id to the lines. I tried splitting the shapefile into 3 smaller shapefiles each with 100 features (ids of 1-100, 101-200, 201-301 respectively). The same result occurred, with the incorrect assignment of the prof_id in the csv file generated. The incorrect result for the first smaller shapefile (first 100 features) was the same as the incorrect result as when I tried on the shapefile with all 301 features present.

If you can identify a reason and possible fix for this I would be very grateful. I can supply the relevant files if needed.

Hi Mauro,
I have sent you an email with a link to the files in a compressed zip folder.

cheers, Rob

I just tried to process the same data in the latest release for QGIS 3, the same result occurred.

I checked 'layer has multiple profiles', and also set the line order id to be my 'id' attribute in the shapefile, and the order is still incorrect. I have tried only checking the box 'layer has multiple profiles', and it still performs it incorrectly.

Are you saying that I should not check the 'layer has multiple profiles' box and only set the line order id?

I am saying that what you are looking for is still to be implemented.
The results that you are obtaining by setting the "multiple profile" option are (very probably) correct under the current implementation: multiple profiles with their id given by the order of the feature in the attribute table, not by the line order field that has another, completely different purpose.
If you set "multiple profiles" the "line order field" is currently ignored, since it refers only to the merging of different lines into a single profile, not regulating the plot order of multiple profiles.
I would implement this new feature but probably not before next week end.

Ah I see, sorry for the confusion. that's great, thanks very much for your help.

I have downloaded and extracted the code to the usual folder:

C:\Users\MyUsername\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qProf-0.4.1RC1

after uninstalling the old release for QGIS3, release 0.4.0.

however, on trying to install the plugin from plugin manager I get the following error message:

Couldn't load plugin 'qProf-0.4.1RC1'

ModuleNotFoundError: No module named 'qProf-0'
Traceback (most recent call last):
File "C:/PROGRA1/QGIS31.0/apps/qgis/./python\qgis\utils.py", line 311, in loadPlugin
import(packageName)
File "C:/PROGRA1/QGIS31.0/apps/qgis/./python\qgis\utils.py", line 664, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'qProf-0'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version: 3.0.3-Girona Girona, 8a899c8758

It seems to have worked! Thats great, I am very grateful.

Released improved version as 0.4.1.