Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Processing] "Points to path" algorithm calculates incorrect attributes values #55860

Closed
2 tasks done
agiudiceandrea opened this issue Jan 16, 2024 · 0 comments · Fixed by #55917
Closed
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore

Comments

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jan 16, 2024

What is the bug or the crash?

The "Points to path" (native:pointstopath) C++ processing algorithm calculates incorrect values of the begin and end fields in the attribute table of the output line layer in some circumstances.

The issue didn't occur using the "Points to path" (qgis:pointstopath) Python processing algorithm in QGIS 3.16.

Steps to reproduce the issue

Using the following GeoJson layer (also provided as Points.zip zipped file):

{
"type": "FeatureCollection",
"name": "Points",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "ID": "A", "ord": 1 }, "geometry": { "type": "Point", "coordinates": [ 11.97, 43.32 ] } },
{ "type": "Feature", "properties": { "ID": "A", "ord": 3 }, "geometry": { "type": "Point", "coordinates": [ 13.18, 42.69 ] } },
{ "type": "Feature", "properties": { "ID": "A", "ord": 2 }, "geometry": { "type": "Point", "coordinates": [ 12.79, 43.52 ] } },
{ "type": "Feature", "properties": { "ID": "A", "ord": 5 }, "geometry": { "type": "Point", "coordinates": [ 14.71, 41.43 ] } },
{ "type": "Feature", "properties": { "ID": "A", "ord": 4 }, "geometry": { "type": "Point", "coordinates": [ 13.94, 42.04 ] } },
{ "type": "Feature", "properties": { "ID": "B", "ord": 1 }, "geometry": { "type": "Point", "coordinates": [ 15.94, 40.53 ] } },
{ "type": "Feature", "properties": { "ID": "B", "ord": 3 }, "geometry": { "type": "Point", "coordinates": [ 17.07, 41.63 ] } },
{ "type": "Feature", "properties": { "ID": "B", "ord": 2 }, "geometry": { "type": "Point", "coordinates": [ 16.44, 41.11 ] } }
]
}

as "Input point layer" of the "Points to path" (native:pointstopath) processing algorithm and setting the ID field as "Groups field" and the ord field as "Order field", then the output line layer contains the correct feature geometries but the incorrect values of the begin and end fields of the attribute table:

ID begin end
A 3 4
B 1 2

while it should be:

ID begin end
A 1 5
B 1 3

Versions

The issue occurs using the latest QGIS 3.28.14, QGIS 3.34.2 and QGIS 3.35.0-Master

QGIS version
3.35.0-Master
QGIS code branch
master
Qt version
5.15.11
Compiled against Python
3.11.7
Running against Python
3.11.6
GDAL/OGR version
3.8.3
PROJ version
9.3.1
EPSG Registry database version
v10.098 (2023-11-24)
GEOS version
3.12.1-CAPI-1.18.1
SQLite version
3.44.1
PostgreSQL client version
unknown
SpatiaLite version
5.1.0
QWT version
6.2.0
QScintilla2 version
2.13.4
OS version
Windows 7 Version 6.1 (Build 7601: SP 1)

This copy of QGIS writes debugging output.

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

The processing algorithm has been ported to C++ with PR #40014 since QGIS 3.18.

@agiudiceandrea agiudiceandrea added Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant