mach0 / qchainage

Chainage Plugin for QGIS
GNU General Public License v3.0
19 stars 18 forks source link

Duplicated feature id #26

Open lutangar opened 1 year ago

lutangar commented 1 year ago

QGIS version 3.10.4-A Coruña Qchainage version 3.0.1

When I run qchainage it output a layer where each feature has the same fid: 1.

The main issue is, when attempt to make the layer permanent, for example saving it as a gpkg the following error happens :

Could not make temporary scratch layer permanent.
Error: Feature write errors:
Feature creation error (OGR error: failed to execute insert : UNIQUE constraint failed: xxx.fid)

Each feature should be given a unique fid. The fid could be, for example, the feature index.

mach0 commented 1 year ago

Hi and thanks for you report. that fid:1 is the feature id taken from the feature you chainage (I know it was probably not the best idea to also call it fid). I will change that in the next release probably to "source_fid". I should rewrite that whole plugin anyway, as it was one of my first but - well the time is always the limiting factor. For now you can use the "Points along geometry" algorythm from the processing toolbox too (until you need a specific function from my plugin). and BTW: you should use a recent version of QGIS too - 3.10 is already a little outdated.