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

QGIS offset line shows perpendicular tags issue #53165

Closed
1 of 2 tasks
MrLando1 opened this issue May 19, 2023 · 13 comments · Fixed by #53234
Closed
1 of 2 tasks

QGIS offset line shows perpendicular tags issue #53165

MrLando1 opened this issue May 19, 2023 · 13 comments · Fixed by #53234
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! geos Regression Something which used to work, but doesn't anymore Symbology Related to vector layer symbology or renderers

Comments

@MrLando1
Copy link

What is the bug or the crash?

I'm adding data to a road network using LRS. I am offsetting the data to show different lanes of the road. In the example below I only have data for 1 lane.

However, some of the data shows an additional perpendicular "tag" towards the original network line. At some scales the "tag" disappears if I change the dimension to "meters at scale". If there is data for multiple lanes, then the tag is showing for the data for each lane. I have checked the network line (using Vector > Geometry Tools > Extract Vertices) and there are no additional vertices which could be responsible for this.

I tried turning off the layer's rendering properties simplify geometry setting

I'm using 3.28.2 but it also occurs on 3.30.1. HOWEVER, I have just discovered that if I load the project into 3.18.3, then issue does not occur (see 2nd image).
Offset Data showing perpendicular lines
Offset Data showing perpendicular lines 3 18 3 no Tags

Steps to reproduce the issue

  1. Use LRS "events" to plot data onto a network line.
  2. Set styling so that the data is offset to the left (negative offset) of the network line. (note. if a positive offset is used, the issue still occurs but at other locations along the line)

Versions

Issue occurs on 3.28.2 and 3.30.1.
HOWEVER, I have just discovered that if I load the project into 3.18.3, the issue does not occur

Supported QGIS version

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

New profile

  • I tried with a new QGIS profile

Additional context

No response

@MrLando1 MrLando1 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 19, 2023
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented May 19, 2023

@MrLando1, with "LRS" do you mean the extarnal Python "LRS" plugin https://plugins.qgis.org/plugins/lrs/? If yes, does the issue occur without the need to use such plugin? Could you please provide sample layer and project with which the issue does occur?

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label May 19, 2023
@MrLando1
Copy link
Author

Hi @agiudiceandrea Yes, It was the external python LRS plugin, but I think that isn't what is causing the issue as the issue doesn't occur in all versions of QGIS..

I can confirm that the issue occurs in v3.28.2 and v3.30.1
I can confirm that the issue does NOT occur in v3.18.3, v3.22.5 or v3.26.3.

I have just created a Test project. I created four network lines, one relatively straight, one concave curve, cone convex curve and a spline (S).

I created dummy data in a csv and added it to the project.

I used v.to.points to create start and end nodes and then changed the Length field to show 0m for the start.
I then used LRS to calibrate a route, and used LRS to add the data using the Events tab.

When looking at the data as is, there isn't an issue, but as soon as I do an offset, the tags appear. To show this clearly, I had done an offset of -40 meters at scale

see attached project.
Tag Test 2.zip

@agiudiceandrea agiudiceandrea added Symbology Related to vector layer symbology or renderers Regression Something which used to work, but doesn't anymore and removed Feedback Waiting on the submitter for answers labels May 19, 2023
@strk
Copy link
Contributor

strk commented May 25, 2023

I do see those "tags" both using positive and negative offset. The image shows a SINGLE layer with 3 symbology layers being the original line, a left offset and a right offset (both offsets being 40 units). This is happening for me with QGIS 3.31.0 as of
5d6c016eb07 and GEOS 3.12.0dev-CAPI-1.18.0 with the recent fixes in single-sided buffer..

image

The problem is probably with the line NOT being a single line but a set of joined lines, with the offset curve algorithm not considering the joins, as better shown in this picture:

image

@strk
Copy link
Contributor

strk commented May 25, 2023

I've just tested the same project with QGIS Release 3.22 (using the same GEOS version) and I see the same behaviour

@strk
Copy link
Contributor

strk commented May 25, 2023

MrLando1 what version of GEOS is your working QGIS reporting ?

@agiudiceandrea
Copy link
Contributor

@strk may it be related to #51583?

@strk
Copy link
Contributor

strk commented May 25, 2023

GEOS version seem to have a role here as I'm getting bigger tags when running geos 3.11.2:

image

in one case on offsetcurve is almost a full ring (fid=43):

image

The same map when running against geos 3.10 (a3e863da45608b8a3ae62224fcec99b27f57cf48):

image

There are still intersections but no pependicular lines:

image

@strk
Copy link
Contributor

strk commented May 25, 2023

FID=43 has this WKT: MultiLineString ((553772.06458926980849355 177770.05079236582969315, 553780.92358692409470677 177768.99614978794124909, 553781.83254859340377152 177768.41771963477367535))

@strk
Copy link
Contributor

strk commented May 25, 2023

Smaller project with ONLY the single geometry is here: SmallCase.zip

@strk
Copy link
Contributor

strk commented May 25, 2023

This is the operation which changed behaviour between GEOS-3.10 and GEOS-3.11. In the log we have the return from GEOS-3.11, which is the almost-full-ring one:

GEOSOffsetCurve(LINESTRING (417.9785426266025752 432.5653800140134990, 447.6161954912822694 436.0936720217578113, 450.6571140550076962 438.0288020166335627), 133.819, 0, 2, 2) returned LINESTRING (409.6582865640766045 502.4555309383532631, 402.1593597874252737 565.4465158614327720, 431.7970126521049679 568.9748078691770843, 439.7066040716936186 502.5342399454674478, 415.1760359914131868 493.7847818372570714)

@strk
Copy link
Contributor

strk commented May 25, 2023

Interesting note: using the deprecated GEOSSingleSidedBuffer_r C-API signature works better for the above case

@dr-jts
Copy link

dr-jts commented May 25, 2023

A work-around for this problem is to always use a Quadrant Segments value of at least 8.

(Note that for Offset Curves specified with a Mitre Join the Quadrant Segments value is essentially irrelevant for the output. It should be forced to 8 internally in the GEOS OffsetCurve code - this will be fixed at some point.)

strk added a commit to strk/QGIS that referenced this issue May 25, 2023
Works around a GEOS bug artifacts when using GEOS 3.11.{0,1,2}

Closes qgisGH-53165
@strk
Copy link
Contributor

strk commented May 25, 2023

Thanks @dr-jts - I've filed #53234 with the workaround and will keep an eye on locationtech/jts#980 to port that fix to GEOS as soon as ready

pramsey added a commit to pramsey/geos that referenced this issue May 26, 2023
pramsey added a commit to libgeos/geos that referenced this issue May 29, 2023
pramsey added a commit to libgeos/geos that referenced this issue May 29, 2023
pramsey added a commit to libgeos/geos that referenced this issue May 29, 2023
strk added a commit to strk/QGIS that referenced this issue May 31, 2023
Works around a GEOS bug artifacts when using GEOS 3.11.{0,1,2}

Closes qgisGH-53165 in 3.28 branch
nyalldawson pushed a commit that referenced this issue Jun 1, 2023
Works around a GEOS bug artifacts when using GEOS 3.11.{0,1,2}

Closes GH-53165 in 3.28 branch
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! geos Regression Something which used to work, but doesn't anymore Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants