-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
First and last segments of a closed linestring are not rendered when using a positive line offset #51583
Comments
I can confirm the issue. The issue does occur for both positive or negative line offset depending on the direction of the closed line (clockwise / counterclockwise). |
See: QGIS 3.16 using GEOS 3.8.1 QGIS_3.16-GEOS_3.8.1.mp4QGIS 3.16 using GEOS 3.11.1 QGIS_3.16-GEOS_3.11.1.mp4 |
Wanted to report a related side-effect. In "standard" QGIS 3.16, a self-intersecting polyline could have an offset with no issue. In 3.22 and 3.28, the offset is not drawn in those cases. To further support the GEOS library case, in 3.22.10, with GEOS the issue is not seen, but in 3.22.14 with GEOS 3.11.1 the issue is seen. The image below shows what the output "should" be in case of self intersecting lines (and what is seen in 3.16 / 3.22.10: The black centerline is the polygon. The Red line is an offset line in the stle with possitive offset and the green one has negative offsets. |
I compiled geos and tested both versions 3.10.4 and 3.11.1 with In the table below, LINESTRING(0 0,10 0,10 10,0 10,0 0) will be abreviated [ccw] (for counterclockwise) and LINESTRING(0 0,0 10,10 10,10 0,0 0) [cw].
So, it seems that: a. GEOS does not drop points, but its behaviour changed b. QGIS offsets are signed in the opposite way as GEOS offsets c. QGIS fails when the curve orientation has the same sign as the QGIS offset Open questions:
I found the related source code in QGIS, but I can't attach a debugger on my system, and I do not quite understand it.
@garci66: are you able to run |
I have never tested geosp... im really not familar with it. I can take a look though and see. I also opened an issue on the GEOS side: But in particular it seems related to changes rasised by this issue: and this merged PR seems to be the main change |
in my case, the main problem is with self intersecting polygons such as the following:
With GEOSOP 3.10 the result is
(the multilinestring was expected, as the loop figure has to be cut) while with GEOSOP 3.11.1: which is clearly different (misses the "looped over itself" part) while the other option (negative offset) the result for 3.10 is and for 3.11 its even worse: as its only doing an offset for the first segment of the line and nothing else! |
Another test case in #51750. With issue: https://github.com/qgis/QGIS/suites/10798239191/artifacts/543108183
No issue:
|
From #51750:
|
GEOS behavior has changed but it looks like we are mixing two different issues here:
|
yes... sorry about that. At first I thought they could be related since both seemed to stem from the change in libgeos version. But I can open a separate issue tracking the upstream GEOS issue |
No worries, just wanted to point that out because it wasn't clear for me on a first sight. For me there's no need to open a separate issue - @agiudiceandrea what do you think? |
@pathmapper, it seems such issue has been allegedly fixed in GEOS 3.12 with libgeos/geos@7561b50.
This one is still an issue: #55050. |
Given that one issue is already fixed upstrean and second has a separate ticket should we close this? |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
@alexbruy ... I understand the fix is already in upstream but, pardon my ignorance, do we known when / how it will be integrated into the main QGIS builds? can we get a view of which LTS versions would get the fix? just to be sure so we can test it. |
Also.. seems like #55050 was auto-closed... and not sure its fixed yet |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
I compiled QGIS against GEOS 3.12.1. Same erroneous behaviour. QGIS version: 3.35.0-Master I tested
The visible behaviour of GEOS has not changed in 3.12. GEOS is still working as expected.
I can confirm that, when the duplicated node lies outside of the canvas, the offset works as expected. (does QGIS sends only part of the linestring to GEOS? Or is the resulting closed offset curve truncated before QGIS deletes the duplicated node?)
#55050 is being closed as a duplicate of this bug. |
See also #58932 and libgeos/geos#1037. |
What is the bug or the crash?
On a Linestring dataset, I use a Simple Line symbology with a positive offset of 0.5 mm. When the dataset contains closed linestrings, on the closed linestrings the first and last segment are not displayed. See the attached project files (rename to .qgs):
test_3_10.qgs
test_3_22.qgs
This bug appears only for positive offsets. I tested with millimeters and map units, same behaviour. I tested geographic (EPSG:4326) and projected (EPSG:2154) CRS, same behaviour. I tested various join style and cap style, same behaviour. I tested two file format versions for the QGIS project file, same behaviour.
Steps to reproduce the issue
Versions
I tested several versions.
Not affected versions: 3.10.10 (8b051b9a43, tested on Windows), 3.16.16 (f5778a89df, tested on Windows), 3.22.14 (Release 3.22, tested on Debian GNU/Linux 11 (bullseye))
Affected versions: 3.22.14 (4cde646c, tested on Windows), 3.28.2 (b47e00ba601, tested on Windows), and master (91886a22e, tested on Debian GNU/Linux sid)
Some of the About tables, by order of citation:
3.16.16 not affected
<style type="text/css"> p, li { white-space: pre-wrap; } </style>3.22.14 not affected
QGIS version
3.22.14-Białowieża
QGIS code branch
Release 3.22
Qt version
5.15.2
Python version
3.9.2
GDAL/OGR version
3.2.2
PROJ version
7.2.1
EPSG Registry database version
v10.008 (2020-12-16)
GEOS version
3.9.0-CAPI-1.16.2
SQLite version
3.34.1
PostgreSQL client version
13.9 (Debian 13.9-0+deb11u1)
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.11.6
OS version
Debian GNU/Linux 11 (bullseye)
Active Python plugins
processing
2.12.99
grassprovider
2.12.99
sagaprovider
2.12.99
3.22.14 affected
<style type="text/css"> p, li { white-space: pre-wrap; } </style>master affected
QGIS version
3.29.0-Master
QGIS code revision
91886a2
Qt version
5.15.8
Python version
3.11.1
GDAL/OGR version
3.6.2
PROJ version
9.1.1
EPSG Registry database version
v10.076 (2022-08-31)
GEOS version
3.11.1-CAPI-1.17.1
SQLite version
3.40.1
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.13.3
OS version
Debian GNU/Linux bookworm/sid
This copy of QGIS writes debugging output.
Active Python plugins
Supported QGIS version
New profile
Additional context
The real dataset is a road graph with loops.
Github reports more than 5000 commits between the affected 3.22.14 master and the unaffected 3.22.14 release 3.22 . I don't have tools to handle such a large diff.
I do not know the QGIS source code well enough to localise what may cause this strange behaviour. I may be able to test your ideas, though.
The text was updated successfully, but these errors were encountered: